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

Nuxt generate (SSG) does not update components outside of NuxtPage on locale change #2944

Open
Tienisto opened this issue May 9, 2024 · 0 comments

Comments

@Tienisto
Copy link

Tienisto commented May 9, 2024

Environment

  • Operating System: Darwin
  • Node Version: v20.12.2
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: pnpm@9.0.6
  • Builder: -
  • User Config: devtools, modules, i18n
  • Runtime Modules: @nuxtjs/i18n@8.3.1
  • Build Modules: -

Reproduction

Implementation:

  1. use prefix_except_default or prefix_and_default
  2. add locale switcher outside of <NuxtPage>
  3. build SSG (nuxt generate / pnpm run generate)

Steps to reproduce the issue:

  1. Change browser locale to de-DE and open the page.
  2. It should redirect to de version of the page (http://localhost:3000/de).
  3. Click on EN to switch to English version of the page.
  4. The error: See that EN is disappears (it should not) and also in the console you will see an error: TypeError: t is null

See minimal example repo: https://github.com/Tienisto/nuxt-i18n-bug

Describe the bug

When adding a locale switcher outside of <NuxtApp> and using SSG, switching locale after initial redirect based on browser locale fails.

See minimal example: https://github.com/Tienisto/nuxt-i18n-bug

Additional context

No response

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant