diff --git a/packages/kit/src/template.ts b/packages/kit/src/template.ts index 9de92087c9..023bbeff91 100644 --- a/packages/kit/src/template.ts +++ b/packages/kit/src/template.ts @@ -232,11 +232,9 @@ export async function writeTypes (nuxt: Nuxt) { // This is needed for Nuxt 2 which clears the build directory again before building // https://github.com/nuxt/nuxt/blob/2.x/packages/builder/src/builder.js#L144 // @ts-expect-error TODO: Nuxt 2 hook - const unsub = nuxt.hook('builder:prepared', writeFile) + nuxt.hook('builder:prepared', writeFile) await writeFile() - - unsub() } function renderAttrs (obj: Record) {