-
-
Notifications
You must be signed in to change notification settings - Fork 522
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
Can Not Re-assign $apollo #924
Comments
👏 following. experiencing the same issue with multiple web component. 👍 |
this not only affects standard web components built using vue, it affects any page with multiple vue applications or independently built components. really hoping this basic sanity check makes the next update as it is such a quick and obvious fix. |
vuejs#924 Added the recommended sanity check .hasOwnProperty that is best practice for .defineProperty to fix .$apollo redefinition bug when using more than one Vue application on a page, or multiple vue built standard web components, like a web component library. This bug is a show stopper for using vue-apollo in standard web components but fortunately was easily fixable by adding the standard best practices check around the block to prevent redefinition. Also worth noting that this same issue it has occurred and crept back into this project several times.
Added a pull request with the proposed fix. Thanks! 👍 |
i am having this same problem right now with vite |
Describe the bug
Multiple web-components on a page implementing vue-apollo 3.0.3. lead to re-definition error of
$apollo
To Reproduce
Steps to reproduce the behavior:
Uncaught TypeError: Cannot redefine property: $apollo
Expected behavior
packages>vue-apollo>src>index.js
the Apollo package would wrap define in a check to see if $apollo is already defined.Versions
vue: "^2.6.11"
vue-apollo: 3.0.3
apollo-client: "^2.6.4"
Additional context
Seems that this was a past issue, and had been resolved, and then removed?
#358
66b8cc9#diff-6c29e3b5395a867dff4aa2f0dc7124b2
I would have added a PR, but could not figure out how to build dist files.
The text was updated successfully, but these errors were encountered: