-
Notifications
You must be signed in to change notification settings - Fork 469
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
HMR not working when updating locale files with lazy: true #905
HMR not working when updating locale files with lazy: true #905
Comments
I'm not sure if there is a way to fix that. I can't see one at least. We'd need to manually trigger re-load of locales on HMR event but I don't see any way to add a hook for that. |
Have same problem. When I change some locale text in our Related to #807 ? |
There was a change 6.13.3 that made the default locale be loaded from NuxtState to avoid an extra network request on initial load. Could be that that broke HMR. |
Ah, would you know anyway to circumvent this? This issue slows down our coding every day so I would be glad if we can fix this ) |
Ok, thank you for the tip... |
Had this issue too. Hope it gets fixed until then, I found that we can set this kind of configuration.
Thanks to #644 who helped me find this one ! EDIT: nvm, it's still buggy. 😭 |
@kissu you need to downgrade as well to make it work? |
@tvld tried your version, wiped my Didn't thought about it at first, thanks ! 🙏🏻 Do we know where does it come from ? |
For what it is worth, I use these settings: i18n: {
vueI18n: {
fallbackLocale: 'en',
// messages: {
// en: require('./assets/lang/en.coffee'),
// nl: require('./assets/lang/nl.coffee')
// },
silentTranslationWarn: true
},
seo: false, // memory leak / performance issue if = true?
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'site_language',
alwaysRedirect: true,
fallbackLocale: 'en'
},
// loadLanguagesAsync: true,
defaultLocale: 'en',
strategy: 'prefix_except_default',
// parsePages: true
lazy: true,
langDir: 'assets/lang/',
locales: [
{
name: 'English',
code: 'en',
iso: 'en-US',
file: 'en.coffee'
},
{
name: 'Nederlands',
code: 'nl',
iso: 'nl-NL',
file: 'nl.coffee'
}
],
vuex: {
moduleName: 'my-i18n',
syncLocale: false,
syncMessages: false,
syncRouteParams: true
}
}, But I must say for now I use only English, I did not test in quite some time the language switching... ) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I have the same issue with these packages "nuxt": "^2.15.2", I tried both the lazy and the non lazy options. Sometimes I need to reload the whole server and sometimes only the page. Did you find any solution ? Thanks
|
@rchl now I get:
|
Which nuxt-i18n version exactly? I might have broken it in the today's release but previous should work |
If it's still failing with previous version then you might want to provide reproduction steps |
same issue here when using I tried
I created a new issue: #1252 |
I recently ran into a similar issue... I solved it by simplifying my folder structure. My folder structure looked something like this; I changed it to something like; And that solved the issue I wrote about it in detail here 👉: https://vorlume.com/nzesalem/stories/nuxt-file-changes-not-triggering-rebuild-in-nuxt-and-how-i-fixed-it |
Version
nuxt-i18n: 6.15.1
nuxt: 2.14.6
Nuxt configuration
mode:
Nuxt-i18n configuration
Reproduction Link
https://github.com/Akryum/nuxt-i18n-hmr
Steps to reproduce
What is Expected?
What is actually happening?
Browser console:
Workaround
The text was updated successfully, but these errors were encountered: