Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

vue-apollo defineProperty called on non-object vue 3 #1496

Unanswered
cbloss asked this question in Q&A
Discussion options

Hello! I've been battling this all day with no luck. I'm trying to upgrade to Vue 3 from 2. I have vue-apollo 3.1.0 installed and I'm running into this error: Uncaught TypeError: Object.defineProperty called on non-object and it points to this line in vue-apollo.

if (!Object.prototype.hasOwnProperty.call(Vue, '$apollo')) {
 Object.defineProperty(Vue.prototype, '$apollo', {
 get: function get() {
 if (!this.$_apollo) {
 this.$_apollo = new DollarApollo(this);
 }
 return this.$_apollo;
 }
 });
 }

Which prototype has been dropped in vue 3 and when I try to run the following:

import { createApp } from 'vue'
const app = createApp({});
app.use(VueApollo);

...the last line causes the error about the error. I was hoping someone has tried to upgrade before and has ran into this. Thanks!

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /