Open kongku opened 3 months ago
Normally things may happens like this (let's say your project directory is 'src'):
src/tsconfig.json
src/tsconfig.json
extends src/.nuxt/tsconfig.json
src/.nuxt/tsconfig.json
includes src/.nuxt/nuxt.d.ts
src/.nuxt/nuxt.d.ts
references the src/.nuxt/components.d.ts
src/.nuxt/components.d.ts
who declares an interface _GlobalComponents {...}
which holds the auto-imported components including <ContentDoc/>
'ContentDoc': typeof import("../node_modules/@nuxt/content/dist/runtime/components/ContentDoc.vue")['default']
inside components.d.ts
ContentDoc.vue.d.ts
who goes along with the ContentDoc.vue
in node_modules/@nuxt/content/dist/runtime/components/
which will be imported when the .vue
file being importedstateDiagram-v2
A: src/tsconfig.json
B: src/.nuxt/tsconfig.json
C: src/.nuxt/nuxt.d.ts
D: src/.nuxt/components.d.ts
A -->B
B --> C
C --> D
In conclusion, I don't think this is a bug related to Nuxt Content or its build system. It's more likely related to the Vue Plugin you used in your VS Code or the TypeScript language server in your VS Code. If every steps above looks good, please have a try to restart your TS server.
Environment
Reproduction
no
Describe the bug
With the exception of the ContentRendererMarkdown component, all components are written using the options style and defineComponent function without lang="ts", and the relevant declares in the components.d.ts file in the .nuxt directory are as follows, which loads not a d.ts file, but a .vue file, causing vscode's intellisense to fail on these components。
![image](https://github.com/nuxt/content/assets/29189288/d0ac7c6a-472f-43da-9fa0-a1d1c641a73d)
Looking at the source code, there is a lang="ts". I tried to compile the source code, same thing. Is this a bug in @nuxt/module-builder?![image](https://github.com/nuxt/content/assets/29189288/5c5d7643-2b7d-46db-916e-bcc7deac0038)
So I need to add the declarations for these components myself。
Additional context
No response
Logs
No response