@tanstack/react-query not working with Vite
what I am using: .
When I am trying to execute a basic query against supabase, using Vite and react-query, useQuery gets stuck in loading state.

14 Replies
absent-sapphire•3y ago
Does the Supabase function return a promise that resolves/rejects?
genetic-orangeOP•3y ago
I don't know exactly. I use
await when fetching data could that mean that it returns a promise?absent-sapphire•3y ago
Async functions always return a promise but I'd look at what's happening with the Supabase function. TanStack Query works perfectly fine with Vite
genetic-orangeOP•3y ago
This seems to be related to vite or react-query, i.e. I am either wrapping inside queryclientprovider wrong or it is not available where I use it. I don't know. I replaced supabase request with regular fetch and still the whole thing gets paused
absent-sapphire•3y ago
Please can you provide a runnable reproduction so we can take a look for you?
genetic-orangeOP•3y ago
I will
5 mins
genetic-orangeOP•3y ago
absent-sapphire•3y ago
Thanks for supplying a reproduction. This works as expected for me. Does it not work for you?
genetic-orangeOP•3y ago
I don't get any response. In the object returned by useQuery I see that isPaused is true
and this is happening all the time
request is being paused
so do you see the whole response object rendered on the screen?
absent-sapphire•3y ago
Yeah, I do
If it's paused I wonder if it's an issue with the network on which you're running in?
genetic-orangeOP•3y ago
ow wow I just noticed that on firefox everything works fine. It is chrome doing some weird stuff
thank you Louis, if it were not for you I would spend another 5 days searching for the cause
absent-sapphire•3y ago
Awesome, no worries :reactquery:
itchy-amethyst•3y ago
There's some version of chrome where navigator.onLine has a bug :/ upgrading chrome should hopefully solve it
adverse-sapphire•3y ago
My Chrome is up-to-date and I think I ran into this same issue. Safari works fine, Firefox works fine.
@bkyerv FWIW, I had to reinstall Chrome and it was all working fine again. First time I ever had to reinstall a browser xD