Skip to content
Source
Sign inSign up
TanStack/query

No QueryClient set, use QueryClientProvider to set one #6604

Send to my agent
ClosedManuelandro(GitHub profile, opens in a new tab) opened this issue 6 comments

Describe 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 Screenshot 2023-12-28 alle 14 14 56

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 Screenshot 2023-12-28 alle 14 21 15

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

  1. 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

  2. TkDodo closed this

  3. TkDodo added labelswontfix

  4. TkDodo added labelsupstream

  5. TkDodo removed labelswontfix

  6. TkDodo added labelsinvalid

  7. @TkDodo thanks for the reply. I downgraded to @tanstack/react-query v4 since wagmi rc is not documented yet, but the problem persists

  8. 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

  9. @kaushikriya were you able to fix the issue?

  10. @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

  11. @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.1 in my lock file 🤔

Sign in to join this conversation.