React Query 3.19.1 not working with Vite 2.4.4 | No QueryClient set, use QueryClientProvider to set one #2539
Replies: 3 comments
-
the code clearly shows that you are using it's the reason why all examples:
This is standard react-context behaviour. |
Beta Was this translation helpful? Give feedback.
-
@TkDodo Thanks for clearing that out. That solved the error I was having, but now I got a new error. The data field is undefined, I tried with several API calls but the error remains the same |
Beta Was this translation helpful? Give feedback.
-
data can be undefined for various reasons, for example, because the query is loading, or possibly you have not returned the data in the format you are expecting from the queryFn. it's impossible to say from just a screenshot. please create a codesandbox reproduction with your issue, then I'm happy to take a look at it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I bootstrapped a React App with Vite 2.4.4 and on using React Query it shows an error however the same react code works with CRA.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Screenshots

Desktop Configurations:
Additional details
The error in the console says, "No QueryClient set, use QueryClientProvider to set one", But it is clearly visible in the code I provided, that an instance of QueryClient is set to QueryClientProvided.
Beta Was this translation helpful? Give feedback.
All reactions