Skip to content

Cannot redefine property: $apollo when used with mixins #34

@wojciechczerniak

Description

@wojciechczerniak

Vue-apollo mixin registers beforeCreate hook and it's called multiple times with components that are using mixins which results in an error: Cannot redefine property: $apollo

Some other plugins have guards against double initialization: vue-resource/index.js#L13 or vue-router/install.js#L7

Vue.use() function (in /use.js#L8) is guarded against double install too.

Maybe some kind of if(this.$apollo) { return; } before you defineProperty would help?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions