-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Getting cannot read property 'subscribeToMore' of undefined #6437
Comments
Probably related to apollographql/react-apollo#3931. |
Facing this as well - might also be related to #6405 (and is still present in apollo v3.0.2) |
I am using this with Angular 10,
This way the query reference becomes available to the subscriptions, However sometimes it results as
Do you guys found some solution? |
I was able to fix this: What was causing problem: What fixed the problem: (On server side - NestJs)
|
Same issue here. I think it has something to do with react fresh which is now the standard refresh mechanism in CRA 4.0.0 |
I'm getting this error with React 17.0.1 after removing "import React from 'react'". If I put the import of React back into code, it works. Looks like subscribeToMore does not support new jsx transform. |
"react": "^17.0.1", `const subscribeToNewMessage = () => {
}` `useEffect(() => { }, [])` Cannot read property 'subscribeToMore' of undefined how to fix? |
@detorresvc I assume as part of upgrading to React 17 you removed "import React from 'react'". I found that subscribeToMore does not always support it. Try putting "import React from 'react'" back as a workaround for now. |
Still facing the issue Object.QueryData._this.obsSubscribeToMore [as subscribeToMore]
node_modules/@apollo/client/react/data/QueryData.js (83:55) |
Having the same issue, I'm already using the import React from "react" statement which doesn't seem to help. |
Can anybody fix it ? |
I had the same problem. |
switching to useLayoutEffect was my solution also |
wow, that looks nice. |
Intended outcome:
subscribeToMore
returning the subscription in every refresh.Actual outcome:
subscribeToMore
works on the first load of component. The time it refreshes or it's saved, it returnssubscribeToMore
as undefined.How to reproduce the issue:
Versions
The text was updated successfully, but these errors were encountered: