bridge icon indicating copy to clipboard operation
bridge copied to clipboard

ERROR Nitro is not initialized yet. You can call useNitro() only after ready hook.

Open antlionguard opened this issue 3 years ago • 1 comments

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

antlionguard avatar Sep 28 '22 16:09 antlionguard

image

antlionguard avatar Oct 04 '22 15:10 antlionguard

I am having the same issue declaring the nitro property in the bridge config.

Draccano avatar Oct 30 '22 18:10 Draccano

I am also having this issue when attempting to run with Nitro set to false.

matthewfee avatar Nov 21 '22 12:11 matthewfee

~Same, using the workaround below~

export default defineNuxtConfig({
  bridge: {
    nitro: process.env.NODE_ENV === 'production',
  },
  ...
})

Actually this instead

yarn add --dev [email protected]

homerjam avatar Dec 13 '22 18:12 homerjam

I am trying to upgrade a nuxt app v2 using bridge and I am facing the same issue:

image

nuxt.config.ts:

image

marabesi avatar Aug 15 '23 08:08 marabesi

In this case you should run nuxt and not nuxi.

danielroe avatar Aug 15 '23 09:08 danielroe