Skip to content

[Composition API] Cannot read property 'value' of undefined when using useSubscription #903

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
kabukki opened this issue Jan 9, 2020 · 0 comments

Comments

@kabukki
Copy link

kabukki commented Jan 9, 2020

Describe the bug
A simple call to useSubscription throws an Error, but the subscription still seems to work.

To Reproduce
Use useSubscription anywhere.

Example:
useSubscription(require('@/graphql/map/subMoved.gql'));
If that matters, here are the file contents:

subscription subMoved {
    moved {
        character {
            id
        }
        position
    }
}

Expected behavior
No error should be happening

Versions
vue: 2.6.10
vue-apollo: 3.0.0-beta.11
@vue/composition-api: 0.3.4
apollo-client: 2.6.8

Additional context

vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in callback for immediate watcher "function () { return source.value; }": "TypeError: Cannot read property 'value' of undefined"
TypeError: Cannot read property 'value' of undefined
    at updateRestartFn (useSubscription.js?801b:100)
    at restart (useSubscription.js?801b:112)
    at eval (useSubscription.js?801b:119)
    at applyCb (vue-composition-api.module.js?750b:911)
    at shiftCallback_1 (vue-composition-api.module.js?750b:920)
    at VueComponent.callback (vue-composition-api.module.js?750b:923)
    at VueComponent.Vue.$watch (vue.runtime.esm.js?2b0e:4949)
    at createWatcher (vue-composition-api.module.js?750b:927)
    at Module.watch (vue-composition-api.module.js?750b:963)
    at useSubscription (useSubscription.js?801b:117)
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