Madyan
Madyan
TtRPC
Created by Madyan on 12/12/2024 in #❓-help
Type mismatch with queryClient prop of @trpc/react-query
Getting the following type-check error:
src/providers/query-client.tsx:49:42 - error TS2322: Type 'import("/<...>/node_modules/@tanstack/query-core/build/modern/hydration-CLZ8NKV0", { with: { "resolution-mode": "import" } }).b' is not assignable to type 'import("/<...>/node_modules/@tanstack/query-core/build/modern/hydration-C0fOPJLA").b'.
Property '#private' in type 'QueryClient' refers to a different member that cannot be accessed from within type 'QueryClient'.

49 <trpc.Provider client={clients.trpc} queryClient={clients.query}>
~~~~~~~~~~~

../../node_modules/@trpc/react-query/dist/internals/context.d.ts:56:5
56 queryClient: QueryClient;
~~~~~~~~~~~
The expected type comes from property 'queryClient' which is declared here on type 'IntrinsicAttributes & TRPCProviderProps<BuiltRouter<{ ctx: { signal: AbortSignal; user: User | null; }; meta: object; errorShape: DefaultErrorShape; transformer: true; }, DecorateCreateRouterOptions<...>>, unknown>'


Found 1 error in src/providers/query-client.tsx:49
src/providers/query-client.tsx:49:42 - error TS2322: Type 'import("/<...>/node_modules/@tanstack/query-core/build/modern/hydration-CLZ8NKV0", { with: { "resolution-mode": "import" } }).b' is not assignable to type 'import("/<...>/node_modules/@tanstack/query-core/build/modern/hydration-C0fOPJLA").b'.
Property '#private' in type 'QueryClient' refers to a different member that cannot be accessed from within type 'QueryClient'.

49 <trpc.Provider client={clients.trpc} queryClient={clients.query}>
~~~~~~~~~~~

../../node_modules/@trpc/react-query/dist/internals/context.d.ts:56:5
56 queryClient: QueryClient;
~~~~~~~~~~~
The expected type comes from property 'queryClient' which is declared here on type 'IntrinsicAttributes & TRPCProviderProps<BuiltRouter<{ ctx: { signal: AbortSignal; user: User | null; }; meta: object; errorShape: DefaultErrorShape; transformer: true; }, DecorateCreateRouterOptions<...>>, unknown>'


Found 1 error in src/providers/query-client.tsx:49
I deleted all trpc/tanstack dependencies, and reinstalled them using the command below, but still the same issue:
pnpm add @trpc/server@next @trpc/client@next @trpc/react-query@next @tanstack/react-query@latest
pnpm add @trpc/server@next @trpc/client@next @trpc/react-query@next @tanstack/react-query@latest
Any idea what's wrong?
2 replies