-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
Lazy loading messages broken in production build #2353
Comments
same problem here. i still have a |
Same problem here. Translations broken only in production build. |
@erikuit Try adding the following to your "overrides": {
"@intlify/bundle-utils": "7.0.2",
"@intlify/message-compiler": "9.3.0-beta.24",
"@intlify/shared": "9.3.0-beta.24"
} It looks like this only fixes the translation on the client-side though, so it throws a hydration mismatch error and untranslated text is visible on load for a short moment. @kazupon |
@BobbieGoede Thanks for the workaround! Can confirm that this also works for my original project. |
@erikuit Happy to hear it works! Something different may be going on altogether, the issue in the reproduction can be solved by simply adding |
@BobbieGoede Interesting! I have |
Same issue with me. And it only happens on the production build. Here are my settings: // nuxt.config.ts
i18n: {
lazy: true,
langDir: 'lang',
defaultLocale: 'en',
locales: [
{ code: 'en', file: 'en.json' },
{ code: 'es', file: 'es.json' },
],
detectBrowserLanguage: {
useCookie: true,
redirectOn: 'root',
cookieKey: 'i18n_redirected',
},
},
// i18n.config.ts
export default defineI18nConfig(() => ({ legacy: false, locale: 'en' })); I have my project using the I tried using the workaround @BobbieGoede suggested but it's still not working. EDIT: I'm getting this inside the logs but for every single key:
|
For anyone using {
"pnpm": {
"overrides": {
"@intlify/bundle-utils": "7.0.2",
"@intlify/message-compiler": "9.3.0-beta.24",
"@intlify/shared": "9.3.0-beta.24"
}
}
} |
Yeah, 😅 I have confirmed that the edge channel version works correctly on the reproduction repo. The workaround is to override it with the override function of the package manager or use the edge channel version. I will release v8.0.0-rc.4 soon. That should solve this issue. |
I've just released nuxt i18n v8.0.0-rc.4 |
Solved the issue on my end. Thank you! |
For me too! Thanks! |
Environment
Nuxt project info:
👉 Report an issue: https://github.com/nuxt/nuxt/issues/new
👉 Suggest an improvement: https://github.com/nuxt/nuxt/discussions/new
👉 Read documentation: https://nuxt.com
Reproduction
https://stackblitz.com/edit/github-ihvwd9?file=nuxt.config.ts
Describe the bug
Translation messages are no longer loading in the production build when using
lazy: true
andlangDir
in the configuration. The development build works as expected.Additional context
Problem started occuring a few hours ago, could it somehow be related to 417af83 ?
Downgrading to @nuxtjs/[email protected] didn't resolve the issue.
Logs
No response
The text was updated successfully, but these errors were encountered: