Skip to content

rejected promises triggered by devtools causes crash #2014

@yinghaochan

Description

@yinghaochan

Describe the bug
If there's a query which throws, usually const { status, data, error } = useQuery(...) one would just use error and render the error in jsx

However, if that throw is the result of clicking refetch in the devtools, the entire app crashes (see screenshot)

To Reproduce
Steps to reproduce the behavior:
https://codesandbox.io/s/strange-drake-9dyow?resolutionWidth=320&resolutionHeight=675&file=/pages/index.js

  1. Open the repro demo in browser
  2. wait for a auto refetch to fail (it fails 50% of the time)
  3. See the page change
  4. hit refetch in devtools until it fails
  5. app crashes

Expected behavior
App does not explode :P

Screenshots
when rejected naturally:
image
When 'refetched' by devtools:
image

Desktop (please complete the following information):

  • OS: macOS
  • Browser: chrome
  • Version: canary

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions