diff --git a/packages/nuxt/src/core/nitro.ts b/packages/nuxt/src/core/nitro.ts index 086fd8ee1d..c938e1ccff 100644 --- a/packages/nuxt/src/core/nitro.ts +++ b/packages/nuxt/src/core/nitro.ts @@ -141,7 +141,7 @@ export async function initNitro (nuxt: Nuxt) { // Add typed route responses nuxt.hook('prepare:types', async (opts) => { - if (nuxt.options._prepare) { + if (!nuxt.options.dev) { await scanHandlers(nitro) await writeTypes(nitro) }