Closed mkalantar closed 3 years ago
Thank you for your reporting!
Unfortunately, I couldn't reproduce this issue. 😞 We need the minimum repo. Could you provide your reproduce code with the repo, please?
Glad I found this - got the same problem as well. Spend the last few hours stripping everything out of my app and traced it down to this package. As soon as I use()
it, any changes in the <script>
section of any SFCs no longer get hot reloaded. However changes within the <template>
section still work fine as mentioned above.
Seems this problem could only be reproduced with legacy mode, not the Composition API mode. Please note that the legacy mode will be set by default.
I think this is a simple enough work around: you can set the legacy
to false
when calling createI18n
.
// 2. Create i18n instance with options
const i18n = createI18n({
legacy: false,
locale: 'ja', // set locale
fallbackLocale: 'en', // set fallback locale
messages, // set locale messages
// If you need to specify other options, you can set other options
// ...
})
Trying to figure out what's wrong here.
Seems this is caused by mixin
. With this line of code commented, the HMR could work.
Seems this problem could only be reproduced with legacy mode, not the Composition API mode. Please note that the legacy mode will be set by default. I think this is a simple enough work around: you can set the
legacy
tofalse
when callingcreateI18n
.// 2. Create i18n instance with options const i18n = createI18n({ legacy: false, locale: 'ja', // set locale fallbackLocale: 'en', // set fallback locale messages, // set locale messages // If you need to specify other options, you can set other options // ... })
Trying to figure out what's wrong here.
You are right, turning off legacy mode make it work.
Just opened a new issue in vue-next
about this with a fix.
Reporting a bug?
in new vue3 project created by vue-cli@4.5.13, using vue-i18n-next make HMR stop working. template changes are detected but changes in script section like methods and lifehook methods are not.
Expected behavior
Changes in script section of SFC affect without refreshing browser.
Reproduction
just use vue-i18n-next in new vue3 project created by vue-cli@4.5.13
main.js :
removing
.use(i18n)
makes HMR work again!System Info
Screenshot
No response
Additional context
No response
Validations