i18n icon indicating copy to clipboard operation
i18n copied to clipboard

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

Open TheDutchCoder opened this issue 10 months ago • 3 comments

Environment


  • Operating System: Linux
  • Node Version: v18.18.0
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: [email protected]
  • Builder: -
  • User Config: devtools, auth, modules, runtimeConfig
  • Runtime Modules: @sidebase/[email protected], @nuxtjs/[email protected]
  • Build Modules: -

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 avatar Apr 16 '24 16:04 TheDutchCoder

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

TheDutchCoder avatar Apr 16 '24 16:04 TheDutchCoder

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.

BobbieGoede avatar Apr 16 '24 20:04 BobbieGoede

Thanks Bobbie I appreciate it!

TheDutchCoder avatar Apr 16 '24 21:04 TheDutchCoder

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!

BobbieGoede avatar May 27 '24 20:05 BobbieGoede