react-query-firebase icon indicating copy to clipboard operation
react-query-firebase copied to clipboard

Error: No QueryClient set, use QueryClientProvider to set one

Open bennik88 opened this issue 3 years ago • 2 comments

Problem: react-query-firebase always show the error Error: No QueryClient set, use QueryClientProvider to set one. My provider is given like in the newest docs.

What I've tried

  • Setting -> <ReactQueryDevtools initialIsOpen={false} />
  • Setting -> contextSharing={true}>

__app.tsx

<QueryClientProvider client={queryClient} contextSharing={true}>
    <Navbar />
        <Component {...pageProps} />
        {/* <ReactQueryDevtools initialIsOpen={false} /> */}
</QueryClientProvider>

useFirestoreDocument usage error

Error: No QueryClient set, use QueryClientProvider to set one
  const docRef = doc(collection(db, "users"), uid);
> 35 |   const extendedUser = useFirestoreDocument(["users", uid], docRef);

System and npm info: OS: Mac OS Monterey "firebase": "^9.9.2", "@tanstack/react-query": "^4.1.0", "next": "12.2.4", "react": "18.2.0",

bennik88 avatar Aug 13 '22 16:08 bennik88

Ah so this will hopefully be fixed once everything works with Tanstack query 4

related: https://github.com/invertase/react-query-firebase/issues/56

cabljac avatar Aug 17 '22 14:08 cabljac

Something else to consider; if you have multiple versions of RQ or React in your node modules for some reason it might be resolving from the wrong location.

Ehesp avatar Aug 17 '22 15:08 Ehesp