vue-i18n: Cannot read property 'locale' of undefined
Hi.I use the vue-router with vue-i18n together,when i changed the path,chrome remind a issue

my i18n.js
import Vue from 'vue'
import VueI18n from 'vue-i18n'
import cn from './zh-CN.json'
import jh from './zh-JH.json'
import store from '../store'
Vue.use(VueI18n)
export default new VueI18n({
locale: 'zh-JH',
messages: {
'zh-CN': cn,
'zh-JH': jh
}
})
vue & vue-i18n version
```"vue": "^2.1.0",
"vue-i18n": "^6.0.0-alpha.2",
"vue-router": "^2.0.1",```
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 8
- Comments: 57 (18 by maintainers)
https://github.com/ChangJoo-Park/vue-i18n-error
Here is my repo
in the
localesdirectory,Error message
Is this Webpack issue?
@kazupon Hi. I have successfully reproduced the bug thanks to @zce 's advice!
https://github.com/h6ah4i/vue-i18n-issue-118-sample
Released v6.0.0-beta.1 Please check it! https://github.com/kazupon/vue-i18n/releases/tag/v6.0.0-beta.1
@ChangJoo-Park Thank you for your reporting and repo providing! Sorry, my bad. vue-i18n API is breaking changed! Please See the docs: https://kazupon.github.io/vue-i18n/en/
Hi everyone! Thank you for your cooperation.
I could reproduce this issue. https://jsfiddle.net/w431Lez7/22/
I’ll try to fix.
@kazupon Here 🌞 Hope useful