jlarmst
jlarmst3mo ago

v11 incompatible with `@tanstack/react-query` > 5.59.9

My code, for example, works fine with v5.59.9:
const [greet] = trpc.tfdExample.greet.useSuspenseQuery(
"there tfdExample!",
{
initialData,
},
);
const [greet] = trpc.tfdExample.greet.useSuspenseQuery(
"there tfdExample!",
{
initialData,
},
);
But, now errors in v5.59.13 with:
Argument of type '{ initialData: { greeting: `hello, ${string}!`; } | undefined; }' is not assignable to parameter of type 'UseTRPCSuspenseQueryOptions<{ greeting: `hello, ${string}!`; }, { greeting: `hello, ${string}!`; }, TRPCClientErrorLike<{ input: string; output: { greeting: `hello, ${string}!`; }; transformer: true; errorShape: DefaultErrorShape; }>>'.
Property 'queryFn' is missing in type '{ initialData: { greeting: `hello, ${string}!`; } | undefined; }' but required in type 'UseTRPCSuspenseQueryOptions<{ greeting: `hello, ${string}!`; }, { greeting: `hello, ${string}!`; }, TRPCClientErrorLike<{ input: string; output: { greeting: `hello, ${string}!`; }; transformer: true; errorShape: DefaultErrorShape; }>>'.
Argument of type '{ initialData: { greeting: `hello, ${string}!`; } | undefined; }' is not assignable to parameter of type 'UseTRPCSuspenseQueryOptions<{ greeting: `hello, ${string}!`; }, { greeting: `hello, ${string}!`; }, TRPCClientErrorLike<{ input: string; output: { greeting: `hello, ${string}!`; }; transformer: true; errorShape: DefaultErrorShape; }>>'.
Property 'queryFn' is missing in type '{ initialData: { greeting: `hello, ${string}!`; } | undefined; }' but required in type 'UseTRPCSuspenseQueryOptions<{ greeting: `hello, ${string}!`; }, { greeting: `hello, ${string}!`; }, TRPCClientErrorLike<{ input: string; output: { greeting: `hello, ${string}!`; }; transformer: true; errorShape: DefaultErrorShape; }>>'.
tRPC version is 11.0.0-rc.571
1 Reply
Nick
Nick3mo ago
this is being worked on, there's an open PR on github you can track (maybe even closed now actually)

Did you find this page helpful?