diff --git a/packages/nuxt3/src/components/module.ts b/packages/nuxt3/src/components/module.ts index d4676bd23a..dbdc8439ea 100644 --- a/packages/nuxt3/src/components/module.ts +++ b/packages/nuxt3/src/components/module.ts @@ -79,7 +79,9 @@ export default defineNuxtModule({ }) nuxt.hook('prepare:types', ({ references }) => { - references.push({ path: resolve(nuxt.options.buildDir, 'components.d.ts') }) + if (components.length) { + references.push({ path: resolve(nuxt.options.buildDir, 'components.d.ts') }) + } }) // Watch for changes