"No QueryClient set" after react-query update to 5.85.6.
Hey 👋🏽
today I updated my
react-query
dependency in a react app from 5.85.5 to 5.90.1, which uses tanstack/react-router
. Suddenly I get
"No QueryClient set, use QueryClientProvider to set one
errors, but only in production (what bit me 😅 ).
I also noticed that the bundle size has been increased by 10 kb (unzipped).
I took a closer look and found that the error does not occur with 5.85.5, but does occur with 5.85.6 and higher.
Maybe somebody know what's going on.
Here's the return of my main.jsx
As I said, in development, everything works fine, in production I get No QueryClient set, use QueryClientProvider to set one
-errors. Furthermore my asset-size increases by about 12 kb (unzipped)
Thanks4 Replies
genetic-orange•2w ago
that really sounds like you have two versions of RQ now
ratty-blushOP•2w ago
Thanks @TkDodo 🔮 . You're absolutely right. But it's very weird. I do indeed have a pnpm mono-repo with a package that has react-query as a peer dependency.
The app we are talking about has this package as a dependency.
package.json of shared-features
package.json of app
Can you explain how there can be two different versions in the prod-build? In my opinion, only 5.85.5 should be included in the build.
Thanks
genetic-orange•2w ago
I'd check what your lock file says
ratty-blushOP•19h ago
Thanks!