nuxt instance unavailable at useNuxtApp
See original GitHub issueEnvironment
- Operating System:
MacOS Big Sur 11.5.2
- Node Version:
v16.15.0
- Nuxt Version:
v3.0.0-rc.4
- Package Manager:
yarn@1.22.18
- Builder:
vite
- User Config:
buildModules
,srcDir
,runtimeConfig
- Runtime Modules:
-
- Build Modules:
-
Reproduction
https://github.com/mogi86/study-nuxt3/tree/v0.0.3
Describe the bug
No error occurs when yarn dev
is executed. However, when yarn preview
is executed after yarn build
, the following error occurs.
Am I using useNuxtApp
incorrectly?
Additional context
No response
Logs
yarn run v1.22.18
$ nuxt preview
Nuxt CLI v3.0.0-rc.4 12:53:06
ℹ Node.js version: 16.15.0 12:53:06
ℹ Preset: node-server 12:53:06
ℹ Working dir: .output 12:53:06
ℹ Starting preview command: node ./server/index.mjs 12:53:06
12:53:06
Listening on http://0.0.0.0:3000/
Error: nuxt instance unavailable
at useNuxtApp (file:///path/to/study-nuxt3/.output/server/node_modules/nuxt/dist/app/nuxt.mjs:119:13)
at setup (file:///path/to/study-nuxt3/.output/server/chunks/app/server.mjs:3731:20)
at _sfc_main$g.setup (file:///path/to/study-nuxt3/.output/server/chunks/app/server.mjs:3756:25)
at callWithErrorHandling (file:///path/to/study-nuxt3/.output/server/chunks/handlers/renderer.mjs:2536:23)
at setupStatefulComponent (file:///path/to/study-nuxt3/.output/server/chunks/handlers/renderer.mjs:8182:30)
at setupComponent (file:///path/to/study-nuxt3/.output/server/chunks/handlers/renderer.mjs:8163:12)
at renderComponentVNode (file:///path/to/study-nuxt3/.output/server/chunks/handlers/renderer.mjs:10510:17)
at Object.ssrRenderComponent (file:///path/to/study-nuxt3/.output/server/chunks/handlers/renderer.mjs:10946:12)
at _sfc_ssrRender (file:///path/to/study-nuxt3/.output/server/chunks/app/server.mjs:4440:32)
at renderComponentSubTree (file:///path/to/study-nuxt3/.output/server/chunks/handlers/renderer.mjs:10591:13)
[nuxt] [request error] nuxt instance unavailable
at useNuxtApp (./server/node_modules/nuxt/dist/app/nuxt.mjs:119:13)
at setup (./server/chunks/app/server.mjs:3731:20)
at _sfc_main$g.setup (./server/chunks/app/server.mjs:3756:25)
at callWithErrorHandling (./server/chunks/handlers/renderer.mjs:2536:23)
at setupStatefulComponent (./server/chunks/handlers/renderer.mjs:8182:30)
at setupComponent (./server/chunks/handlers/renderer.mjs:8163:12)
at renderComponentVNode (./server/chunks/handlers/renderer.mjs:10510:17)
at Object.ssrRenderComponent (./server/chunks/handlers/renderer.mjs:10946:12)
at _sfc_ssrRender (./server/chunks/app/server.mjs:4440:32)
at renderComponentSubTree (./server/chunks/handlers/renderer.mjs:10591:13)
[nitro] [dev] [unhandledRejection] TypeError: $setup.hello is not a function
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Nuxt instance unavailable on all pages · Issue #4287 - GitHub
I get error nuxt instance unavailable when play with i18n config, properties seo: false or strategy: 'prefix'. [nitro] [dev] [unhandledRejection] ...
Read more >Nuxt Instance Unavailable throw error - StackBlitz
Editor Preview Both. Sign in. Project. Search. Ports in use. Settings. Switch to Light Theme. Enter Zen Mode. Project. Download Project. Info. Nuxt...
Read more >FATAL Nuxt instance is unavailable - Stack Overflow
I've just pulled from repo, ran npm install and then i run npm run dev now i get the error FATAL Nuxt instance...
Read more >NuxtApp · Nuxt Advanced
In Nuxt 3, you can access runtime app context within composables, components and ... const nuxtApp = useNuxtApp() // access runtime nuxt app...
Read more >The context - Nuxt
The root Vue instance options that includes all your plugins. ... Vue Router route instance. ... Not available via nuxt generate .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you close the issue then?
Yes, I can close. Thank you for your support.