Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intellisense for components are not available #2586

Open
kongku opened this issue Mar 16, 2024 · 0 comments
Open

Intellisense for components are not available #2586

kongku opened this issue Mar 16, 2024 · 0 comments

Comments

@kongku
Copy link

kongku commented Mar 16, 2024

Environment

  • Operating System: Windows_NT
  • Node Version: v20.10.0
  • Nuxt Version: 3.10.3
  • CLI Version: 3.10.1
  • Nitro Version: 2.9.3
  • Package Manager: pnpm@8.15.1
  • Builder: -
  • User Config: modules
  • Runtime Modules: @nuxt/content@2.12.1
  • Build Modules: -

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
image
image

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

So I need to add the declarations for these components myself。

declare module 'vue' {
  export interface GlobalComponents {
    ContentDoc: typeof import('./node_modules/@nuxt/content/dist/runtime/components/ContentDoc')['default']
    ContentList: typeof import('./node_modules/@nuxt/content/dist/runtime/components/ContentList')['default']
    ContentNavigation: typeof import('./node_modules/@nuxt/content/dist/runtime/components/ContentNavigation')['default']
    ContentQuery: typeof import('./node_modules/@nuxt/content/dist/runtime/components/ContentQuery')['default']
    ContentRenderer: typeof import('./node_modules/@nuxt/content/dist/runtime/components/ContentRenderer')['default']
    ContentSlot: typeof import('./node_modules/@nuxt/content/dist/runtime/components/ContentSlot')['default']
    DocumentDrivenEmpty: typeof import('./node_modules/@nuxt/content/dist/runtime/components/DocumentDrivenEmpty')['default']
    DocumentDrivenNotFound: typeof import('./node_modules/@nuxt/content/dist/runtime/components/DocumentDrivenNotFound')['default']
    Markdown: typeof import('./node_modules/@nuxt/content/dist/runtime/components/Markdown')['default']
  }
}
export {}

Additional context

No response

Logs

No response

@kongku kongku changed the title Wrong name in component declaration file invalidates component's intellisense Intellisense for components are not available Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant