From 423cbf53302753e0c6071af89c843a2c0dff9232 Mon Sep 17 00:00:00 2001 From: Alex Kozack Date: Mon, 13 Jun 2022 12:31:52 +0300 Subject: [PATCH 1/3] fix: Build all types on typecheck command fix: https://github.com/nuxt/framework/issues/5109 --- packages/nuxi/src/commands/typecheck.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxi/src/commands/typecheck.ts b/packages/nuxi/src/commands/typecheck.ts index 227d0771ba1..24a7b11fcde 100644 --- a/packages/nuxi/src/commands/typecheck.ts +++ b/packages/nuxi/src/commands/typecheck.ts @@ -19,9 +19,9 @@ export default defineNuxtCommand({ const { loadNuxt } = await loadKit(rootDir) const nuxt = await loadNuxt({ rootDir, config: { _prepare: true } }) - // Generate types and close nuxt instance + // Generate types and build nuxt instance await writeTypes(nuxt) - await nuxt.close() + await buildNuxt(nuxt) // Prefer local install if possible const hasLocalInstall = tryResolveModule('typescript', rootDir) && tryResolveModule('vue-tsc/package.json', rootDir) From d4ee7994fd7b0be3f54a0130d48774cedfdfb5f3 Mon Sep 17 00:00:00 2001 From: Alex Kozack Date: Mon, 13 Jun 2022 12:41:54 +0300 Subject: [PATCH 2/3] fix --- packages/nuxi/src/commands/typecheck.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxi/src/commands/typecheck.ts b/packages/nuxi/src/commands/typecheck.ts index 24a7b11fcde..a0b42409a38 100644 --- a/packages/nuxi/src/commands/typecheck.ts +++ b/packages/nuxi/src/commands/typecheck.ts @@ -16,7 +16,7 @@ export default defineNuxtCommand({ process.env.NODE_ENV = process.env.NODE_ENV || 'production' const rootDir = resolve(args._[0] || '.') - const { loadNuxt } = await loadKit(rootDir) + const { loadNuxt, buildNuxt } = await loadKit(rootDir) const nuxt = await loadNuxt({ rootDir, config: { _prepare: true } }) // Generate types and build nuxt instance From a222ee0b38face6e10157f7c6b28b1b28a8e9ccd Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 23 Aug 2022 22:49:25 +0200 Subject: [PATCH 3/3] ensure nuxt is disposed --- packages/nuxi/src/commands/typecheck.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nuxi/src/commands/typecheck.ts b/packages/nuxi/src/commands/typecheck.ts index a0b42409a38..d578cd02386 100644 --- a/packages/nuxi/src/commands/typecheck.ts +++ b/packages/nuxi/src/commands/typecheck.ts @@ -22,6 +22,7 @@ export default defineNuxtCommand({ // Generate types and build nuxt instance await writeTypes(nuxt) await buildNuxt(nuxt) + await nuxt.close() // Prefer local install if possible const hasLocalInstall = tryResolveModule('typescript', rootDir) && tryResolveModule('vue-tsc/package.json', rootDir)