T
TanStack3y ago
fair-rose

Uncaught Error: No QueryClient set, use QueryClientProvider to set one

I am using a wrapper in the main consumer project to provide a query client for my private package. But it's not taking the context of the Main Project declaration ?
No description
No description
No description
6 Replies
sensitive-blue
sensitive-blue3y ago
This usually means you have two copies of react-query, each having their own react context so they don't see each other
fair-rose
fair-roseOP3y ago
Yeah, in my private package, there is also react-query. The problem I am facing is when I transpile my personal package it's not sharing context, but on the other hand, if I publish my package without transpiling then it works. Any idea why?
sensitive-blue
sensitive-blue3y ago
Does it have TanStack query as a peerDependency?
fair-rose
fair-roseOP3y ago
yes
fascinating-indigo
fascinating-indigo3y ago
@n!neart$ Did you figure this out? I'm running into the same issue.
fair-rose
fair-roseOP3y ago
I changed my code transpile from babel to tsc. Than it worked for my private package

Did you find this page helpful?