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: ^ (copy pasted from https://trpc.io/docs/client/react/setup) These are my relevant package versions: what am I doing wrong?
Solution:Jump to solution
Just run the npm install again and you should be good or downgrade @tanstack/react-query to
@tanstack/query@4
7 Replies
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 believeSolution
Just run the npm install again and you should be good or downgrade @tanstack/react-query to
@tanstack/query@4
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? @BeBoREnpm
@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.You are probably looking at the next branch
Pretty sure that on the next branch the version gets transformed
the default branch (next) is for v11
v10 requires tanstack query v4
Gotcha, thanks very much 👍