nuxt-modules / i18n

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

nuxt/i18n + sidease/nuxt-auth wipes out all types from the config file #2915

Closed TheDutchCoder closed 4 months ago

TheDutchCoder commented 5 months ago

Environment


Reproduction

https://stackblitz.com/edit/github-js6xqk?file=composables%2FuseThing.ts

Describe the bug

Bear with me for this one, I'm not sure which module is to blame here, but the combo of these two modules removes all type definitions from the runtime config.

You can see, in the composable, that .foo is no longer typed when both modules are enabled. When I disable either of these modules, types generate correctly.

Bug report on sidebase/nuxt-auth: https://github.com/sidebase/nuxt-auth/issues/737

Additional context

No response

Logs

No response

TheDutchCoder commented 5 months ago

Downgrading i18n to 8.1.1 fixes the issue, so I'm fairly sure the problem is with this module. Moving to 8.2.0 and this issue starts appearing, so something broke in that release

BobbieGoede commented 5 months ago

It's unclear why downgrading to an older version works, I haven't tested this or looked into that. It seems like the types break due the nuxt-auth module not augmenting the runtime config types in the same way as we do, I've opened https://github.com/sidebase/nuxt-auth/pull/738 that will resolve this on their end.

We can keep this issue open in case other users experience the same thing and close it when the PR has been merged and released.

TheDutchCoder commented 5 months ago

Thanks Bobbie I appreciate it!

BobbieGoede commented 4 months ago

Closing this issue as https://github.com/sidebase/nuxt-auth/pull/738 has been merged and included in https://github.com/sidebase/nuxt-auth/releases/tag/0.8.0-alpha.1!