Skip to content

Apollo "Cannot set property hello of #< VueComponent> which has only a getter" #295

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

Closed
iliyaZelenko opened this issue Dec 8, 2018 · 4 comments

Comments

@iliyaZelenko
Copy link

iliyaZelenko commented Dec 8, 2018

Hello, I use vue-apollo with your library.

I get this error

Error in data(): "TypeError: Cannot set property hello of #< VueComponent> which has only a getter"

when I have this code

@Component({
  apollo: {
    hello: {
      query: gql`{hello}`
    }
  }
})
export default class Home extends Vue {
  hello = 'test'
}

Am I doing something wrong or is it a bug?

Versions:

vue-class-component 6.3.2
vue 2.5.18 (recently released, maybe that's the problem)

I do not even know how to replace vue 2.5.18 with 2.5.17.
I don't have vue in "dependencies" (using nuxt)
I have yarn, i tried

"resolutions": {
    "vue": "2.5.17"
}

and than yarn install, but yarn info vue version shows 2.5.18


Also the following code will work:

@Component({
  data () {
    return {
      hello: 'test'
    }
  },
  apollo: {
    hello: {
      query: gql`{hello}`
    }
  }
})
export default class Home extends Vue {}
@ktsn
Copy link
Member

ktsn commented Dec 9, 2018

Please provide a minimal / self-contained reproduction when you report a bug. Thanks.

@ktsn ktsn added the need repro label Dec 9, 2018
@ktsn
Copy link
Member

ktsn commented Dec 10, 2018

It is not a reproduction and not seems to be related to this issue. See #294

@iliyaZelenko
Copy link
Author

Well, I will try to show on the project when will i have time. But I have exactly this error.

Perhaps she is also associated with apollo-module package for nuxt.

The error is rather strange, if property is in the class, then how it can only have a getter?

@ktsn
Copy link
Member

ktsn commented Jan 16, 2019

Sorry we cannot help you without reproduction. Closing until reproduction is provided.

@ktsn ktsn closed this as completed Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants