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 ?



6 Replies
sensitive-blue•3y 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-roseOP•3y 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•3y ago
Does it have TanStack query as a peerDependency?
fair-roseOP•3y ago
yes
fascinating-indigo•3y ago
@n!neart$ Did you figure this out? I'm running into the same issue.
fair-roseOP•3y ago
I changed my code transpile from babel to
tsc. Than it worked for my private package