-
-
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
Error is not getting cought when coming back to the window #36
Comments
Thanks for reporting! I’ll have this fixed ASAP
Tanner Linsley
…On Nov 13, 2019, 3:57 PM -0700, Amit Ripshtos ***@***.***>, wrote:
Hey, great library!
I noticed that when I useQuery and it fails, go out of the page and then go back - the error will not be caught in useQuery but be raised to the UI.
How to test?
1. Use useQuery to a endpoint that does not work (using async await)
2. Let it fail one time, go out of the tab and go back in.
3. You should see the Ui crashes.
Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I want to fix that in order to learn more about react-query, mind if you lead me on which part of the code should I look? Thanks! |
Yes I can! But first, could you make a codesandbox that demonstrates the bug so we can work from there? |
Well, I'm trying to mimic the issue using codesandbox, however without any success. The issue I'm seeing is that the development environment catches the error and not react-query - only when I go out and in to the page. |
Ah... yes. The redbox error handler for CRA dev mode is a bit overzealous sometimes. Let me look into this a bit more. |
Just to be clear, are you by chance using Suspense? |
Not using suspense
…On Thu, Nov 14, 2019, 16:55 Tanner Linsley ***@***.***> wrote:
Just to be clear, you're not using Suspense are you?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#36>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACSFNTDSHMXPKN4AH2D6NADQTVRFXANCNFSM4JNC2H7A>
.
|
So the cause of this error is that when then the window is refocused, the Let me know if that's enough info for you to get started on fixing it and feel free to open a PR. I'll help you the rest of the way with a code review there :) |
Thanks for the help, I created a pull request and tested it on my application and it does work! |
Hey, great library!
I noticed that when I useQuery and it fails, go out of the page and then go back - the error will not be caught in useQuery but be raised to the UI.
How to test?
Thanks!
The text was updated successfully, but these errors were encountered: