TanStackT
TanStack3y ago
1 reply
popular-magenta

React code splitting making react query stuck at fetching state

I just implemented a code splitting logic into my project. I do a simple code split in a route level, so the first time we open a page, it will load new JS bundle, and temporarily put a Suspense fallback loading component before the JS bundle loaded.

I just realize that when I do this, the first time I open a page (cache cleared), and calling a useQuery, the query I called is stuck in a fetching state. I try to trace back the request, and my request did go through, and returning a 200 with result. but the data is not coming out from my useQuery hooks.

Is this a known bug? I can't find any pointer regarding this issue
Was this page helpful?