Replies: 7 comments 3 replies
-
So far I found: |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I can't help without more information, sorry. The error occurs because we are using react-context internally, so when we do This can happen for various reasons, like I tried to outline above. With two versions of react or two versions of react-query, the context created by the Provider might not be the same context used by I'll move this to a discussion because it is very very likely not a bug in react-query but in your setup.
It's not about the version numbers, it's about what gets installed. Have you looked at all |
Beta Was this translation helpful? Give feedback.
-
I solved this problem. I created the context on myself
and provided it to the trpc
and QueryClient
|
Beta Was this translation helpful? Give feedback.
-
I found that this worked too: import { defaultContext } from "@tanstack/react-query"
export const api = createTRPCReact<AppRouter>({
reactQueryContext: defaultContext,
}); |
Beta Was this translation helpful? Give feedback.
-
What worked for me was making sure the version of |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
I decided to use expo + trpc stack. But I have some issues with react-query used under the hood of trpc.
The courios thing is that iOS build is working fine but not web configuration.
During my investigations I spotted the place in QueryClientProvider -> getQueryClientContext
Although I placed the QueryClientProvider in code and default context is created, the method can't find it.
So is my app.tsx
my component
trpc-client.ts
and trpc-provider.ts
So is the web error while using useQuery:
babel.config.js
webpack.config.js
How often does this bug happen?
Every time
Screenshots or Videos
Platform
System:
OS: macOS 13.0
CPU: (10) arm64 Apple M1 Max
Memory: 4.32 GB / 64.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.18.1 - ~/.nvm/versions/node/v16.18.1/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.18.1/bin/yarn
npm: 8.19.2 - ~/.nvm/versions/node/v16.18.1/bin/npm
Watchman: 2022.11.14.00 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 108.0.5359.71
Firefox: 107.0
Safari: 16.1
npmPackages:
@tanstack/react-query: ^4.18.0 => 4.18.0
@trpc/client: ^10.4.1 => 10.4.1
@trpc/react-query: ^10.4.1 => 10.4.1
@trpc/server: ^10.4.1 => 10.4.1
next: ^13.0.4 => 13.0.5
react: 18.1.0 => 18.1.0
typescript: ^4.6.3 => 4.9.3
Tanstack Query version
^4.18.0
TypeScript version
No response
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions