ERROR Nitro is not initialized yet. You can call useNitro() only after ready hook.
Environment
- Operating System:
Darwin - Node Version:
v14.17.6 - Nuxt Version:
2.16.0-27720022.54e852f - Nitro Version:
0.5.4 - Package Manager:
[email protected] - Builder:
webpack - User Config:
bridge,serverHandlers,devServerHandlers,buildModules - Runtime Modules:
- - Build Modules:
(),@nuxt/[email protected]
Reproduction
https://stackblitz.com/edit/github-nrsxrr?file=package.json,nuxt.config.ts
- yarn build
Describe the bug
Build command fails with ERROR Nitro is not initialized yet. You can call useNitro() only after ready hook. error. This bug occurred after rc.11.
I just set nitro: falsein nuxt config.
Additional context
No response
Logs
No response

I am having the same issue declaring the nitro property in the bridge config.
I am also having this issue when attempting to run with Nitro set to false.
~Same, using the workaround below~
export default defineNuxtConfig({
bridge: {
nitro: process.env.NODE_ENV === 'production',
},
...
})
Actually this instead
yarn add --dev [email protected]
I am trying to upgrade a nuxt app v2 using bridge and I am facing the same issue:
nuxt.config.ts:
In this case you should run nuxt and not nuxi.