Possible Unhandled Promise Rejection (id: 0). How to handle these warnings? Where do they come from?
See original GitHub issueIntended outcome:
I can’t tell where and why warning is thrown in the code.
Actual outcome:
Stacktrace is absolutely cryptic. No chances to understand why and where warning is thrown.
What is The provided key element?
What schema is does this warning says about? Mutation has two of them: UpdateMutation
and GetQuery
? Which one?
this.props.client.mutate({
mutation: UpdateMutation,
refetchQueries: [{ query: GetQuery }],
Can you tell me where this warning happened?
Does your Apollo have means to show where this warning is thrown?
This happens after mutation.
Versions
System:
OS: macOS High Sierra 10.13.4
Binaries:
Node: 8.11.3 - /usr/local/bin/node
npm: 5.6.0 - /usr/local/bin/npm
Browsers:
Chrome: 68.0.3440.106
Safari: 11.1
npmPackages:
apollo-boost: ^0.1.4 => 0.1.10
apollo-cache-inmemory: ^1.1.0 => 1.2.5
apollo-client: ^2.0.3 => 2.3.5
apollo-link: ^1.0.3 => 1.2.2
apollo-link-http: ^1.2.0 => 1.5.4
react-apollo: ^2.1.1 => 2.1.9
Similar issue https://github.com/apollographql/apollo-client/issues/3858 Same https://github.com/apollographql/apollo-client/issues/431 Same https://github.com/apollographql/apollo-client/issues/423
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:7 (1 by maintainers)
Top Results From Across the Web
React Native: Possible unhandled promise rejection
js code. The url is fine and giving me the correct json data. I can see with console log that both region.latitude and...
Read more >Handling those unhandled promise rejections with JS async ...
You put your code inside an async function in order to use await calls; One of your await ed functions fails (i.e. rejects...
Read more >Tracking Unhandled Promise Rejections - TrackJS
When a promise is rejected, it looks for a rejection handler. If it finds one, like in the example above, it calls the...
Read more >React Native Auth0 Possible Unhandled Promise Rejection
In setting up samples, I've made some progress with the docs, but I've come into this error. Possible Unhandled Promise Rejection (id: 1): ......
Read more >Possible Unhandled Promise Rejection (id: 0): | Mendix Forum
I have upgraded a native mobile app with NFC dependency from 8.6.9 (all working well) to 8.18.4. I built a new dev .apk...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue is still there with 2.6.8 !
Code is working fine, but tests crash with cryptic message.
Adding a .catch() call after the mutation call is working fine, but feels like a gross hack.
Any chance to get this handled in the module ? As @joelgetaction stated, we shouldn’t get a rejected promise there, as it is already handled and the error is available from the useMutation error field to deal with !
Here is the output when testing the module with Jest and react-testing-library:
This error breaks all the test suite, which crashes on that output.
I have to agree. With react-apollo ^2.3.2 I’m able to avoid this by giving a dummy function to
Mutation
’sonError
prop, e.g.