-
-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix TypeError: Cannot redefine property: $i18n #422
Conversation
I confirm this change solves the TypeError ! |
Why this was closed ? |
I have already solved this problem on the project, and this error will occur in the special use of the project. |
@HadiChen could you point the commit that should solve the problem ? After this commit solve the problem in web-component context where you can deploy and try to attach several instance of the vue-i18n component. So it could be usefull to avoid a TypeError for this use case. Thanks |
Just chiming in that I was also waiting for a fix for this. I have a library of Vue components that's using Vue-i18n which is being used in another, larger Vue app that's also using Vue-i18n. |
as long as the vue-i18n used in the project is the same, this error will not occur. |
I still get the error, with both of my package.jsons using the newest 8.1.0. Edit: If I remove Vue-i18n from the library components, it seems to work and it will use the main project's Vue-i18n. So I just can't have two copies. I think I misunderstood what you were saying. Edit 2: And while it does work, my console is now spammed (unsuprisingly with TypeError: "_vm.$t is not a function") |
Can you explain the error in detail? |
So, like previously mentioned I get If I use Vue-i18n only on the library, I can load the app, but I can't use Vue-i18n on it. If I remove Vue-i18n from the library, and only include it in the main app. It will load, but I get a bunch of console errors: Along with Therefore I believe this PR is necessary because there are use cases such as mine where node modules built in vue using the same library will cause a conflict. |
If you want to reproduce the problem I've provided an example in #402 |
fix #421