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

Incorrect translations flash when using different domains with swr route rules #2928

Open
CernyMatej opened this issue Apr 19, 2024 · 0 comments

Comments

@CernyMatej
Copy link

Environment

  • Operating System: Darwin
  • Node Version: v20.9.0
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: [email protected]
  • Builder: -
  • User Config: devtools, modules, routeRules, i18n
  • Runtime Modules: @nuxtjs/[email protected]
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-xumxf5?file=app.vue,nuxt.config.ts,pages%2Findex.vue,package.json

Please note that this will not work on stackblitz because of the custom urls, you need to clone it locally.

Describe the bug

When using different domains in combination with an swr route rule, as shown below:

routeRules: {
    '/': { swr: 60 }
},

and disabling the route prefix by setting domainDefault: true in the locale objects, only the default translation is cached. This results in a flicker upon the first load when displaying other locales.

I'm unsure whether this issue can be addressed within this module or if it requires upstream support from Nitro. Nevertheless, adding a warning to the documentation would be nice to prevent others from spending hours on debugging this as I did 😅

I'd be happy to update the docs if needed.

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