Type 'QueryClient' is missing the following properties from type 'QueryClient': queryCache, mutation

I'm getting this error:
Type 'QueryClient' is missing the following properties from type 'QueryClient': queryCache, mutationCache, logger, defaultOptions, and 4 more.ts(2740) context.d.ts(48, 5): The expected type comes from property 'queryClient' which is declared here on type 'IntrinsicAttributes & TRPCProviderProps<CreateRouterInner<RootConfig<{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { ...; }>, unknown>'
on line:
<api.Provider client={trpcClient} queryClient={queryClient}>
<api.Provider client={trpcClient} queryClient={queryClient}>
^ (copy pasted from https://trpc.io/docs/client/react/setup) These are my relevant package versions:
"@tanstack/react-query": "^5.24.1",
"@trpc/client": "^10.45.1",
"@trpc/react-query": "^10.45.1",
"@trpc/server": "^10.45.1",
"@tanstack/react-query": "^5.24.1",
"@trpc/client": "^10.45.1",
"@trpc/react-query": "^10.45.1",
"@trpc/server": "^10.45.1",
what am I doing wrong?
Solution:
Just run the npm install again and you should be good or downgrade @tanstack/react-query to @tanstack/query@4
B
BeBoRE51d ago
If you did npm install @trpc/server@next @trpc/client@next @trpc/react-query@next @trpc/next@next @tanstack/react-query@latest then you shouldn't get those package versions tRPC v10 doesn't work with react-query v5 I believe
Solution
B
BeBoRE51d ago
Just run the npm install again and you should be good or downgrade @tanstack/react-query to @tanstack/query@4
S
Shooe#646840650d ago
10.45.1 in the source code has a dependency of ^5.0.0 on tanstack react query though: https://github.com/trpc/trpc/blob/cdf215127a172e497468dec04acb8ea12e840e84/packages/react-query/package.json#L61 What am I missing? @BeBoRE
B
BeBoRE50d ago
npm
@trpc/server
The tRPC server library. Latest version: 10.45.1, last published: 25 days ago. Start using @trpc/server in your project by running npm i @trpc/server. There are 295 other projects in the npm registry using @trpc/server.
B
BeBoRE50d ago
You are probably looking at the next branch Pretty sure that on the next branch the version gets transformed
J
julius50d ago
the default branch (next) is for v11 v10 requires tanstack query v4
S
Shooe#646840649d ago
Gotcha, thanks very much 👍
More Posts
How to properly handle Prima selects/includes with tRPC?Hello, my understanding of optimizing procedures to be the most efficient would be to enable one proonSuccess with createTRPCProxyClientWhat is the best way to setup onSuccess with createTRPCProxyClient?trpcNext from client for testingHi guys, I have created a client that uses a mock database for testing. Can I create a context and tMissing content type header for mutations leads to 405Im migrating my app from Next Pages Router to App Router. I implemented the new trpc wrapper as explIs there any way to temporarily disable mutations?My goal is to move into a read-only mode temporarily. I'm thinking anything could be fine as a shoAfter upgrading to 11.0.0-next-beta.300, every request throws zod errorI didn't do anything but upgrading the trpc, and the error throws: ```json {"issues":[{"code":"invaSetting up tRPC for next.js with edge AND serverless functionstldr: I am trying to build an app that uses both edge AND serverless functions by creating separate Hello i am using trpc open api but there is an issue regarding using z.optional() however in the libHello i am using trpc open api but there is an issue regarding using z.optional() however in the libCreateCaller with React-queryHey guys. Is it possible to combine createCaller approach with React-query? I figured out that reactBeginner: form field error handling ?hey guys, I have a question regarding error handling with trpc. How could I specify a form field iZod.enum makes my tRPC explodeI'm having an issue with what appears to be circular dependencies. My problem is that I'm not sure wReact type errors because of backendHello, I'm using tRPC in React and it's working fine generally. However, WebPack always finds somethValue attached to all queriesIs it possible to add a value the all queries so its preset within every procedure call on the clienInvalidating query cache irrespective of query paramsHey is it possible to invalidate a query cache without providing parameters? I have a query for exaSentry integrationHello. I'm using trpc + fastify approach. I need a proper error loggin so I added fastify sentry, whIn my NEXTJS app can read value next-auth session in localhost ,but not when deployed to VercelI have several procedures in my TRPC router (https://github.com/Teodorant1/nighthawk_repair/blob/masWebSocket Authentication: Cookie missingHi community 👋 I'm currently trying to integrate the wsLink, and I've noticed that cookies are noClient request headers with createTRPCProxyClientSimple proxy client, following the documentation ```ts import { createTRPCProxyClient, httpBatchLinkGet auth token from context when defining httpBatchLinkIm setting up an ApiProvider for react query and I want to get the authorization token for the AuthoInfinite query get direction infoHello everyone, I'm implementing a bidirectional infinite query and i would need to access the dire