-
-
Notifications
You must be signed in to change notification settings - Fork 416
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
Nuxt built-in and auto imported components typed as unknown #4170
Comments
|
I have tried using. 2.6, 2.7 and insider versions. What is the hybrid mode ? I don't think I use It. I'm all on vue 3. |
I can confirm this issue with a fresh nuxt content starter. |
Thank you @so1ve I tried a reproduction with a fresh nuxt 3 install but it works like a charm. |
Activating or deactivating the hybrid mode doesn't change anything on my side. |
I found the problem! It's related to nuxt-typed-router. when removing this line in the .nuxt/tsconfig.json Everything works fine. |
@ThomasBerne I tried using reproduction: https://github.com/johnsoncodehk/issue-4170-repro |
Indeed i cannot reproduce either with only the nuxt typed router package. This must be a collision of nuxt packages I guess. I'll try to reproduce it. |
I successfully reproduced adding vuetify and nuxt typed router to a clear nuxt install : I used npm as the default package manager. |
You can see the problem in the pages/[id]/index.vue |
Like if vuetify was overwriting GlobalComponents definition. But only when it is installed alongside of the nuxt-typed-router package. |
Confirmed. 👍 |
I think this problem needs to be solved by Nuxt, currently Nuxt generates GlobalComponents as: declare module 'vue' {
export interface GlobalComponents {
Test: (typeof import('../components/Test.vue'))['default'];
}
} To avoid types being overwritten in the npm node_modules structure, it should probably be generated as: interface _GlobalComponents {
Test: (typeof import('../components/Test.vue'))['default'];
}
declare module '@vue/runtime-core' {
export interface GlobalComponents extends _GlobalComponents { };
}
declare module '@vue/runtime-dom' {
export interface GlobalComponents extends _GlobalComponents { };
}
declare module 'vue' {
export interface GlobalComponents extends _GlobalComponents { };
} @danielroe can you or someone take up this issue? Thanks. |
I use nuxt 3 and Vue Official 2.X+
Built-in and auto imported components are typed as unknown :
Even though they are in the .nuxt/components.d.ts
Imported by the .nuxt/tsconfig.json
.nuxt/tsconfig.json extended by my project tsconfig.json
The text was updated successfully, but these errors were encountered: