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
TypeError: Cannot read property 'fetchMore' of undefined #8071
Comments
@johnobrien8642 Is there any chance the React component has unmounted by the time it calls |
Hi @benjamn, thanks for the quick response. I think that this is possible given my understanding of React. The For a simple example:
I'm most confused by why I've got |
I am also experiencing this issue, onClick of a search, it returns the result but always getting fetchMore is undefined
Even when I did this to event check, I still get the undefined error
|
I have faced this issue many times and one thing that seems to be common is this happens after the hot reload of the code. Maybe, I think as the component is refreshed and a new |
Might help anyone, what worked for me is clearing cache, try to restart the emulator |
Intended outcome:
When using infinite scroll cursor based pagination user should should be able to navigate away from the feed and then back to the feed and have fetchMore continue to work.
Here's an example of a Feed component:
Actual outcome:
This error occurs and breaks the application:
How to reproduce the issue:
This is my field policy:
If I console log
incoming
I can see the returned results, but error still occurs.I've decided I'm going to try to use
useApolloClient
to circumvent fetchMore entirely. Would be awesome to find out I'm doing something wrong or it would be awesome to get this bug fixed if it is indeed one. Really appreciate everyones hard work, I really enjoy learning and using Apollo, looking forward to resolving this.I've seen one or two similar issues but I believe my situation is different enough to warrant a new issue.
Versions
System:
OS: macOS 11.2.3
Binaries:
Node: 15.11.0 - ~/.nvm/versions/node/v15.11.0/bin/node
npm: 7.6.0 - ~/.nvm/versions/node/v15.11.0/bin/npm
Browsers:
Chrome: 90.0.4430.93
Safari: 14.0.3
Apollo and React version:
"@apollo/client": "^3.3.15",
"react": "^17.0.1",
The text was updated successfully, but these errors were encountered: