diff --git a/packages/nuxi/src/commands/dev.ts b/packages/nuxi/src/commands/dev.ts index 8248f3bdb8..856ee932d2 100644 --- a/packages/nuxi/src/commands/dev.ts +++ b/packages/nuxi/src/commands/dev.ts @@ -61,6 +61,7 @@ export default defineNuxtCommand({ } currentNuxt = await loadNuxt({ rootDir, dev: true, ready: false }) await currentNuxt.ready() + await currentNuxt.hooks.callHook('listen', listener.server, listener) await Promise.all([ writeTypes(currentNuxt).catch(console.error), buildNuxt(currentNuxt) @@ -105,9 +106,6 @@ export default defineNuxtCommand({ }) await load(false) - if (currentNuxt) { - await currentNuxt.hooks.callHook('listen', listener.server, listener) - } return 'wait' }