No QueryClient set, use QueryClientProvider to set one #6604
Send to my agentDescribe the bug#
Premise: i got this error only on production (next.js) and not always, just sometimes,
I already found this issue and it seems that having two version (or the same twice) of react-query in the package-lock can cause this issue. The problem is that i have the version 5.0.0 that i use, and another version which is the dependency of the package wagmi that i need for my project
How can i solve the problem without removing wagmi which is required for my project?
I've tried to set it as peerDependency but with no luck
I also tried to downgrade react-query to the same version of the one inside wagmi but again, no results
Your minimal, reproducible example#
i have no repo cause happens only in production
Steps to reproduce#
This happens only in production
Expected behavior#
No error
How often does this bug happen?#
Often
Screenshots or Videos#
No response
Platform#
Sentry notifies errors from many users with multiple platforms
Tanstack Query adapter#
react-query
TanStack Query version#
5.0.0
TypeScript version#
5.0.4
Additional context#
No response
TkDodo closed this
TkDodo added labelswontfix
TkDodo added labelsupstream
TkDodo removed labelswontfix
TkDodo added labelsinvalid
@TkDodo thanks for the reply. I downgraded to @tanstack/react-query v4 since wagmi rc is not documented yet, but the problem persists
wagmi now support tanstack/query v5 as seen here https://www.npmjs.com/package/wagmi?activeTab=code I only have one version installed on my machine
@tanstack/react-query@5.22.2. I'm still facing this exact error @TkDodo@kaushikriya were you able to fix the issue?
@kaushikriya were you able to fix the issue?
@sarthakkundra check if you have two versions of react query in your package-lock. Also try to remove ReacQueryDevTools if you use it
@sarthakkundra @kaushikriya did you figure out what was the issue in your cases? I'm facing the same problem after upgrading wagmi and react-query and run out of ideas already. I double checked and I have only single version
@tanstack/react-query@5.51.1in my lock file 🤔
Sign in to join this conversation.
if you use wagmi and it only supports v4, you have to use v4 as well.
wagmi v2 is currently in RC and it supports v5
https://www.npmjs.com/package/wagmi/v/2.0.0-rc.2