TypeError: Cannot redefine property: $i18n
See original GitHub issuevue & vue-i18n version
ex: 2.5.17, 8.0.0 vue:2.5.17 vue-i18n:8.0.0 nuxt.js:1.4.2
Reproduction Link
Steps to reproduce
What is Expected?
What is actually happening?
https://github.com/kazupon/vue-i18n/blob/170f69109a4e655af607c20bea87b51ab04a16d1/src/extend.js#L5
Object.defineProperty(Vue.prototype, '$i18n', {
get () { return this._i18n }
})
fix bug edit
if (!Vue.prototype.hasOwnProperty('$i18n')) {
Object.defineProperty(Vue.prototype, '$i18n', {
get () { return this._i18n }
})
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Vue I18n - TypeError: Cannot redefine property - Stack Overflow
TypeError : Cannot redefine property: $i18n. The line where this errors appear is this function in the source code:
Read more >Vue-i18n - How to detect if it's present and merge additional ...
Uncaught TypeError: Cannot redefine property: $i18n. Which means that the module is already loaded? But I'm getting follow up errors in my ...
Read more >Possible reasons for " Cannot redefine property " Error ?
Every time when i login to app browser returns this errror, app.js:48343 Uncaught TypeError: Cannot redefine property: $router at Function.
Read more >Vue-Router returns "Cannot redefine property - appsloveworld
[Solved]-Vue-Router returns "Cannot redefine property: $router" error-Vue.js ... Vue add i18n returns ERROR TypeError: Cannot read property 'minVersion' of ...
Read more >vue-i18n | Yarn - Package Manager
object and array values are no longer returned. VueI18n class cannot used with new . It can only be used via the $i18n...
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
@jgribonvald Hi! sorry for my late response.
There is a possibility that this problem is caused by the vue-i18n build setting problem.
kazupon/vue-i18n@1a1958a
Would you be able to try to use the dist files (dist/*.js) that build with build confg of dev branch please? https://kazupon.github.io/vue-i18n/installation.html#dev-build
@kazupon : thanks a lot !