question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot redefine property: $i18n

See original GitHub issue

vue & 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?

image

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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kazuponcommented, Sep 25, 2018

@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

0reactions
jgribonvaldcommented, Oct 15, 2018

@kazupon : thanks a lot !

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found