i18n: Hydration text mismatch with SSR
Environment
- Operating System:
Darwin - Node Version:
v16.17.1 - Nuxt Version:
3.0.0 - Nitro Version:
1.0.0 - Package Manager:
pnpm@7.25.1 - Builder:
vite - User Config:
modules,i18n - Runtime Modules:
@nuxtjs/i18n@8.0.0-beta.8-27906685.5bd81af - Build Modules:
-
Reproduction
https://stackblitz.com/edit/github-gfwhki?file=nuxt.config.ts
Describe the bug
I previously was on this edge version where it worked fine: 8.0.0-beta.7-27893843.b72135e.
After updating to latest beta.8 or even latest edge, I get the following warning in browser console:
[Vue warn]: Hydration text mismatch:
- Client: " => homepage"
- Server: " => Startseite"
at <App key=1 >
at <NuxtRoot>
In the app.vue I display a locale variable. When refreshing the page, you can see that it briefly displays the name of the key and then changes to display the actual (correct) value.
In server console it logs [intlify] Not found 'homepage' key in 'de' locale messages.
Additional context
This doesn’t happen with ssr: false.
Logs
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 3
- Comments: 20 (3 by maintainers)
https://github.com/nuxt-modules/i18n#install-edge-version
I’ve just fixed this issue. You can try to use edge version
Thanks!
Instead of this workaround, upgrading to “@nuxtjs/i18n”: “8.1.1” fixes it.
@kaname-png try edge version. There, it works for me.