nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.71k stars 478 forks source link

[Bug]: Adding i18n module to Nuxt breaks typing for all components in Nuxt app #2839

Closed martinszeltins closed 6 months ago

martinszeltins commented 6 months ago

Environment

Stackblitz

------------------------------
- Operating System: Linux
- Node Version:     v18.18.0
- Nuxt Version:     3.10.3
- CLI Version:      3.10.1
- Nitro Version:    -
- Package Manager:  npm@10.2.3
- Builder:          -
- User Config:      extends
- Runtime Modules:  -
- Build Modules:    -
------------------------------

Reproduction

https://stackblitz.com/github/martinszeltins/found-nuxt-components-issue?file=app.vue

Describe the bug

When I add this module to my modules array in nuxt.config.ts then I lose all typings for my components (for both local and 3rd party components). It shows that components have type of unknown. Before I add this module, everything works.

nuxt.config.ts 👇️

modules: [
+  '@nuxtjs/i18n', // This breaks all auto-import component typings (components not recognized anymore)
   '@vueuse/nuxt',
   'nuxt-primevue'
],

If I remove it from my modules array then everything works again.

Screenshot before adding the module (everything works): 👍️ 👇️

image

Screenshot after adding the module (type unknown): ❌ 👇️

image

Additional context

No response

Logs

No response

BobbieGoede commented 6 months ago

Hmm, I'm pretty sure this is caused by the types provided by primevue. We ran into a similar issue some time ago, I'll see if I can open a PR to fix it on their end.

BobbieGoede commented 6 months ago

As you have noticed, I opened a PR (https://github.com/primefaces/primevue/pull/5419) on their repo to resolve your issue, since this isn't caused by this module I'll close this issue.

I recommend opening an issue on their repo and referencing the PR (and this issue), as their PR template seems to require it, this may not be necessary anymore since they've added the PR to the next milestone.

martinszeltins commented 6 months ago

As you have noticed, I opened a PR (primefaces/primevue#5419) on their repo to resolve your issue, since this isn't caused by this module I'll close this issue.

I recommend opening an issue on their repo and referencing the PR (and this issue), as their PR template seems to require it, this may not be necessary anymore since they've added the PR to the next milestone.

Thank you!