question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible Unhandled Promise Rejection

See original GitHub issue

Apollo 1.0.0-rc.4. React Native 0.42.3

I have some query:

client.query({
  query: SOME_QUERY,
  options: {
    fetchPolicy: 'network-only',
  },
  variables: { ... },
}).then(result => {
  
}).catch(error => {
  console.log(error)
});

And when I turn off my internet connection I am getting this error message: Possible Unhandled Promise Rejection (id: 0):Network error: Network request failed

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
jurajkrivdacommented, Mar 20, 2017

@helfer please reopen this issue. I am getting this error again but now with refetch function. My code

const withData = graphql(PROFILE_QUERY, {
  options: ({ currentUserId }) => ({
    variables: { id: currentUserId }
  }),
  props: ({ ownProps, data: { loading, user, error, refetch } }) => ({
    loading,
    user,
    error,
    refetch
  })
});

const withHomeHandlers = withHandlers({
  refetchUser: props => async() => {
    const { setRefresh, refetch } = props;
    setRefresh(true);
    await refetch();
    setRefresh(false);
  }
});

I see my profile, switch off my internet connection and make refetch then I am see Network Error at props.error. This is fine I can handle errors but I think query is still running and after query timeout I got the same error as above.

1reaction
danilobuergercommented, Oct 14, 2018

For everyone seeing this in refetch, see #3631

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native: Possible unhandled promise rejection
Possible unhandled promise rejection (id:0: Network request failed). Here's the promise code, I don't see what's wrong here, any ideas?
Read more >
React Native Auth0 Possible Unhandled Promise Rejection
My understanding of the error is that it is saying, 'we can't find any value for the Auth0Module object property you are looking...
Read more >
Possible Unhandled Promise Rejection (id:0) #7107 - GitHub
If this object is disturbed or locked, return a new promise rejected with a TypeError. Simply said, the following is likely to produce...
Read more >
Handling those unhandled promise rejections with JS async ...
Another possibility is that you know you need to catch the rejected promise. In this case, what might be happening is this: You...
Read more >
React Native Auth0 Possible Unhandled Promise Rejection
Possible Unhandled Promise Rejection (id: 1): TypeError: undefined is not an object (evaluating '_yield$getCredentials.accessToken').
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found