HMR stops when using vue-i18n-next
See original GitHub issueReporting 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 :
import { createApp } from 'vue'
import App from './App.vue'
import { createI18n } from 'vue-i18n'
const messages = {
en: {
message: {
hello: 'hello world'
}
},
fa: {
message: {
hello: 'سلام'
}
}
}
const i18n = createI18n({
locale: 'fa',
fallbackLocale: 'en'
messages
})
createApp(App).use(i18n).use.mount('#app')
removing .use(i18n)
makes HMR work again!
System Info
Environment Info:
System:
OS: Linux 4.19 Debian GNU/Linux 10 (buster) 10 (buster)
CPU: (4) x64 Intel(R) Core(TM) i5-4440 CPU @ 3.10GHz
Binaries:
Node: 14.15.1 - /usr/local/bin/node
Yarn: Not Found
npm: 7.14.0 - /usr/local/bin/npm
Browsers:
Chrome: 91.0.4472.114
Firefox: 78.11.0esr
npmPackages:
@intlify/vue-devtools: 9.1.6
@vue/babel-helper-vue-jsx-merge-props: 1.2.1
@vue/babel-helper-vue-transform-on: 1.0.2
@vue/babel-plugin-jsx: 1.0.6
@vue/babel-plugin-transform-vue-jsx: 1.2.1
@vue/babel-preset-app: 4.5.13
@vue/babel-preset-jsx: 1.2.4
@vue/babel-sugar-composition-api-inject-h: 1.2.1
@vue/babel-sugar-composition-api-render-instance: 1.2.4
@vue/babel-sugar-functional-vue: 1.2.2
@vue/babel-sugar-inject-h: 1.2.2
@vue/babel-sugar-v-model: 1.2.3
@vue/babel-sugar-v-on: 1.2.3
@vue/cli-overlay: 4.5.13
@vue/cli-plugin-babel: ~4.5.0 => 4.5.13
@vue/cli-plugin-eslint: ~4.5.0 => 4.5.13
@vue/cli-plugin-router: 4.5.13
@vue/cli-plugin-vuex: 4.5.13
@vue/cli-service: ~4.5.0 => 4.5.13
@vue/cli-shared-utils: 4.5.13
@vue/compiler-core: 3.1.4
@vue/compiler-dom: 3.1.4
@vue/compiler-sfc: ^3.0.0 => 3.1.4
@vue/compiler-ssr: 3.1.4
@vue/component-compiler-utils: 3.2.2
@vue/devtools-api: 6.0.0-beta.15
@vue/preload-webpack-plugin: 1.1.2
@vue/reactivity: 3.1.4
@vue/runtime-core: 3.1.4
@vue/runtime-dom: 3.1.4
@vue/shared: 3.1.4
@vue/web-component-wrapper: 1.3.0
eslint-plugin-vue: ^7.0.0 => 7.13.0
vue: ^3.0.0 => 3.1.4
vue-eslint-parser: 7.8.0
vue-hot-reload-api: 2.3.4
vue-i18n: ^9.1.6 => 9.1.6
vue-loader: 15.9.7 (16.3.0)
vue-style-loader: 4.1.3
vue-template-es2015-compiler: 1.9.1
npmGlobalPackages:
@vue/cli: 4.5.13
Screenshot
No response
Additional context
No response
Validations
- Read the Contributing Guidelines
- Read the Documentation
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
vue.js - Hot-Module-Replacement (HMR) suddenly stopped ...
in my vue project, created with vue-cli 3 i had hot reload working fine and than suddenly stopped. in my console, when i...
Read more >HMR API - Vite
Vite exposes its manual HMR API via the special import.meta.hot object: ... First of all, make sure to guard all HMR API usage...
Read more >svelte-hmr - npm
Start using svelte-hmr in your project by running `npm i svelte-hmr`. ... the app's entry point, stopping at accepted module on each branch....
Read more >The State of HMR in Angular - JavaScript in Plain English
It is a Webpack feature that updates changed modules without reloading the whole page. Angular 11 made it easy to use HMR by...
Read more >HMR and Hot Reloading with the webpack-dev-server
Client Side rendering with HMR using react-refresh-webpack-plugin. Basic installation. To enable HMR functionality you have to use ./bin/webpacker-dev-server.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just opened a new issue in
vue-next
about this with a fix.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
.Trying to figure out what’s wrong here.