sh03S
tRPC2y ago
12 replies
sh03

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}>


^ (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",


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
Was this page helpful?