Giter Club home page Giter Club logo

Comments (9)

tannerlinsley avatar tannerlinsley commented on May 14, 2024

from query.

amitripshtos avatar amitripshtos commented on May 14, 2024

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!

from query.

tannerlinsley avatar tannerlinsley commented on May 14, 2024

Yes I can! But first, could you make a codesandbox that demonstrates the bug so we can work from there?

from query.

amitripshtos avatar amitripshtos commented on May 14, 2024

Well, I'm trying to mimic the issue using codesandbox, however without any success.
I'm starting to think that it happens because im in development mode in my react environment.

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.

I'm attaching a image that shows how it looks like.
image

from query.

tannerlinsley avatar tannerlinsley commented on May 14, 2024

Ah... yes. The redbox error handler for CRA dev mode is a bit overzealous sometimes. Let me look into this a bit more.

from query.

tannerlinsley avatar tannerlinsley commented on May 14, 2024

Just to be clear, are you by chance using Suspense?

from query.

amitripshtos avatar amitripshtos commented on May 14, 2024

from query.

tannerlinsley avatar tannerlinsley commented on May 14, 2024

So the cause of this error is that when then the window is refocused, the refetchAllQueries function is called. This function returns a promise and will throw if any of the queries on the page error. So essentially, you don't want the window focus fetcher to throw error into the window, you want to catch the error and just log it to the console.

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 :)

from query.

amitripshtos avatar amitripshtos commented on May 14, 2024

Thanks for the help, I created a pull request and tested it on my application and it does work!

from query.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.