oemer
oemer
Explore posts from servers
NNuxt
Created by LATEEK on 4/12/2024 in #❓・help
Your feedback, what should I use ? Fork || Layer || Module ?
My rule of thumb: - Use the reusable source as long as you can (In this case: Nuxt Layers) - Once you see you have to do too many if-else conditions at too many places to satisfy all requirements, copy-paste it (In this case: Fork)
5 replies
NNuxt
Created by oemer on 2/16/2024 in #❓・help
How to keep order of global middlewares with Nuxt Layers?
Yep i also saw that, lets hope it's merged soon 🙂
3 replies
TTCTheo's Typesafe Cult
Created by oemer on 10/25/2023 in #questions
` npx create t3-app@latest` returns `npm ERR! could not determine executable to run`
Ok with pnpm create t3-app@latest it seems to work now..
6 replies
TTCTheo's Typesafe Cult
Created by oemer on 10/25/2023 in #questions
` npx create t3-app@latest` returns `npm ERR! could not determine executable to run`
running on node v18.17.1
6 replies
TTCTheo's Typesafe Cult
Created by oemer on 10/25/2023 in #questions
` npx create t3-app@latest` returns `npm ERR! could not determine executable to run`
Second part of logs:
24 timing npm:load:display Completed in 2ms
25 verbose logfile logs-max:10 dir:C:\Users\Oemer\AppData\Local\npm-cache\_logs\2023-10-25T09_47_46_304Z-
26 verbose logfile C:\Users\Oemer\AppData\Local\npm-cache\_logs\2023-10-25T09_47_46_304Z-debug-0.log
27 timing npm:load:logFile Completed in 16ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 29ms
31 timing arborist:ctor Completed in 0ms
32 silly logfile start cleaning logs, removing 2 files
33 silly logfile done cleaning log files
34 http fetch GET 200 https://registry.npmjs.org/create 848ms (cache revalidated)
35 timing command:exec Completed in 864ms
36 verbose stack Error: could not determine executable to run
36 verbose stack at getBinFromManifest (C:\Program Files\nodejs\node_modules\npm\node_modules\libnpmexec\lib\get-bin-from-manifest.js:17:23)
36 verbose stack at exec (C:\Program Files\nodejs\node_modules\npm\node_modules\libnpmexec\lib\index.js:188:15)
36 verbose stack at async module.exports (C:\Program Files\nodejs\node_modules\npm\lib\cli.js:89:5)
37 verbose pkgid [email protected]
38 verbose cwd C:\dev
39 verbose Windows_NT 10.0.22621
40 verbose node v18.17.1
41 verbose npm v9.6.7
42 error could not determine executable to run
43 verbose exit 1
44 timing npm Completed in 1105ms
45 verbose code 1
46 error A complete log of this run can be found in: C:\Users\Oemer\AppData\Local\npm-cache\_logs\2023-10-25T09_47_46_304Z-debug-0.log
24 timing npm:load:display Completed in 2ms
25 verbose logfile logs-max:10 dir:C:\Users\Oemer\AppData\Local\npm-cache\_logs\2023-10-25T09_47_46_304Z-
26 verbose logfile C:\Users\Oemer\AppData\Local\npm-cache\_logs\2023-10-25T09_47_46_304Z-debug-0.log
27 timing npm:load:logFile Completed in 16ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 29ms
31 timing arborist:ctor Completed in 0ms
32 silly logfile start cleaning logs, removing 2 files
33 silly logfile done cleaning log files
34 http fetch GET 200 https://registry.npmjs.org/create 848ms (cache revalidated)
35 timing command:exec Completed in 864ms
36 verbose stack Error: could not determine executable to run
36 verbose stack at getBinFromManifest (C:\Program Files\nodejs\node_modules\npm\node_modules\libnpmexec\lib\get-bin-from-manifest.js:17:23)
36 verbose stack at exec (C:\Program Files\nodejs\node_modules\npm\node_modules\libnpmexec\lib\index.js:188:15)
36 verbose stack at async module.exports (C:\Program Files\nodejs\node_modules\npm\lib\cli.js:89:5)
37 verbose pkgid [email protected]
38 verbose cwd C:\dev
39 verbose Windows_NT 10.0.22621
40 verbose node v18.17.1
41 verbose npm v9.6.7
42 error could not determine executable to run
43 verbose exit 1
44 timing npm Completed in 1105ms
45 verbose code 1
46 error A complete log of this run can be found in: C:\Users\Oemer\AppData\Local\npm-cache\_logs\2023-10-25T09_47_46_304Z-debug-0.log
6 replies
NNuxt
Created by oemer on 7/24/2023 in #❓・help
What is the equivalent to `beforeNuxtRender` in Nuxt 3?
Could it be a nitro plugin?
nitroApp.hooks.hook('render:html', (html, { event }) => {
console.log('render:html', html)
html.head.push('<script>...</script>')
})
nitroApp.hooks.hook('render:html', (html, { event }) => {
console.log('render:html', html)
html.head.push('<script>...</script>')
})
2 replies
NNuxt
Created by oemer on 7/6/2023 in #❓・help
How to fix "[module] is not export by [path]" error during build, when it works on development?
@🇨🇭 Marko Bolliger <cannap> Ye, I think the ecosystem is unfortunately not ready to be not "shameful" 😄
6 replies
NNuxt
Created by oemer on 7/6/2023 in #❓・help
How to fix "[module] is not export by [path]" error during build, when it works on development?
Problem was that my workspaces was using commonjs as the target build 🤦‍♂️ I added a new tsconfig.esm.json with the correct ESNext target and now it works even without optimizeDeps. @chakraecho I tried to add it to build.transpile before, but it didn't work. @🇨🇭 Marko Bolliger <cannap> We will hopefully switch to pnpm soon too 🤞 Sometimes I am just tired of this obscure node eco system 😄 Hope that pnpm gives us some valuable restrictions.
6 replies
NNuxt
Created by oemer on 6/16/2023 in #❓・help
What is the suggested alternative to layout middlewares in Nuxt 3?
@wypratama Sorry for my late response. And even though it throws no error, it still doesn't work. Nothing happens.
Also I am using <script lang="ts" setup> and there you cannot return export default. But I also tried it without export default and also using it without script setup notation. No success. I also tried defineComponent. It doesn't seem to be possible.
6 replies
NNuxt
Created by oemer on 6/16/2023 in #❓・help
What is the suggested alternative to layout middlewares in Nuxt 3?
Yes, this is definetely not possible. You can see the error page is telling, that it only works for SFC that are also a page. I found that stackoverflow search, but i did not want to use .global as stated in my original question. I don't want to call the middleware on every page. And I also don't want to nest my pages in /admin, thats why I asked here as well. I ended up using .global middleware, since I didn't found any alternative. Thanks for your help tho!
6 replies
NNuxt
Created by oemer on 6/16/2023 in #❓・help
What is the replacement for `context.req` in a route middleware in nuxt 3?
Is it useRequestEvent? Seems to contain all the information!
const { node: { req } } = useRequestEvent()
const { node: { req } } = useRequestEvent()
2 replies
NNuxt
Created by oemer on 4/28/2023 in #❓・help
Can i set `.env` file path inside `nuxt.config.ts`?
I would love to see an easy API:
//nuxt.config.ts
export default defineNuxtConfig({
dotenv: "../.env",
})
//nuxt.config.ts
export default defineNuxtConfig({
dotenv: "../.env",
})
AFAIK, this was possible in earlier versions of Nuxt.
10 replies
NNuxt
Created by oemer on 4/28/2023 in #❓・help
Can i set `.env` file path inside `nuxt.config.ts`?
@Pratham Interesting approach that could fix my problem as well. However - similar to what you said - it's just way safer and future proof to do it in each package.json for now. Even if it includes some copy-paste. 😄 We use the .env-file only for local development. In a staging and production deployment, the environment variables are added to the docker container, no .env-file there.
10 replies
NNuxt
Created by oemer on 4/28/2023 in #❓・help
Can i set `.env` file path inside `nuxt.config.ts`?
Interesting approach! I saw the c12 with setupDotenv part too in the nuxt code. Was hoping for a defined api instead of a "hacky" like solution. I guess I will just add --dotenv ../.env to every script I need. Currently it seems to be the safest and most clean way to accomplish it.
10 replies
NNuxt
Created by oemer on 4/28/2023 in #❓・help
Can i set `.env` file path inside `nuxt.config.ts`?
Yes that works. But having an option in nuxt.config.ts supports DRY principle. In my case I want to have a base Layer, which imports all .env variable. Layers that extend the base Layer should not have to do this again. Also I think it's more convenient to have all options available in nuxt.config.ts that are available in the package.json, like --dotenv.
10 replies
NNuxt
Created by oemer on 4/27/2023 in #❓・help
Do I need to install dependencies of Layers I am extending in a monorepo?
Well, for me "working" would mean: You don't have to do do any aliasing of the packages. But here I have to do the aliasing manually. Meh. I hoped Layers would help me get cleaner code with less complexity, but here we also have to add some complexity to even use it properly.
6 replies
NNuxt
Created by oemer on 4/27/2023 in #❓・help
Do I need to install dependencies of Layers I am extending in a monorepo?
No description
6 replies