-
Notifications
You must be signed in to change notification settings - Fork 470
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
Hot reloading not working #807
Comments
It works for me when using |
I jumped over to JS because JSON doesn't allow multilines or line concatinations, and I'm using those to keep thing tidy and organized. And also because it does allow comments, which add further clarity. My revelant section of
(Heavily simplified)
I updated everything using Furthermore, the project also doesn't reflect CSS changes inside Thanks in advance |
I wouldn't expect the configuration you are using to work with HMR. |
Can you create a repro repo? Otherwise, I would have to and I don't have time for it :) |
What should I use instead of Lazy imo is not made for that particular purpose, it's meant to load translations in chunks when necessary.
I understand that perfectly, I'll make one later, if we can't solve it ;) |
It's not so much what you are using but where. nuxt.config is not processed by webpack so imports references there won't be watched. While I believe there is way to tell Nuxt manually what files to watch, that wouldn't be ideal as it would most likely do a hard reload of the project rather than incremental HMR. Basically you should try |
I tried lazy to no avail. It refreshes once, but without any noticeable change. |
Then create a reproducible repo. It could be that you are using strings in a way that makes reactivity not work. |
Just created a repo with those exact configurations: https://github.com/Fusseldieb/testi18n In this repo at least it updates the translations on page reload, but doesn't do on its own. |
Do this: diff --git a/nuxt.config.js b/nuxt.config.js
index 83bd4b4..58c230d 100644
--- a/nuxt.config.js
+++ b/nuxt.config.js
@@ -64,16 +64,16 @@ export default {
}
]
],
- i18n: {
- locales: ["en"],
- defaultLocale: "en",
- vueI18n: {
- fallbackLocale: "en",
- messages: {
- en: require("./locales/en.js")
- }
- }
- },
+ // i18n: {
+ // locales: ["en"],
+ // defaultLocale: "en",
+ // vueI18n: {
+ // fallbackLocale: "en",
+ // messages: {
+ // en: require("./locales/en.js")
+ // }
+ // }
+ // },
/*
** Build configuration
** See https://nuxtjs.org/api/configuration-build/ The |
Tried it out and confirmed working, that's awesome, but now I have another problem: When I access the main page (which has rootDir: "test"), it goes to: If I manually reload that same 404 page mentioned above, it jumps to: My Any help would be greatly appreciated :) |
This is documented: https://i18n.nuxtjs.org/basic-usage.html#nuxt-link |
Oh wow! Thanks, works just fine! Don't know how I missed that! I used With the slash I can guarantee that it's absolute and not relative. Thanks so much for your time. It helped a ton! |
I would still suggest using route names instead (even though the |
Don't know if a bug or a question, but when I configure Nuxt with i18n, despite me changing the language file, I need to restart the whole server in order for it to update.
I also tried another solution who mentioned something about "lazy: true" and including langDir inside modules @ nuxt.config.js, to no avail. Now the page reloads only once and also doesn't update.
What am I doing wrong? Is Hot Reloading functional inside Nuxt-i18n?
Thanks in advance!
The text was updated successfully, but these errors were encountered: