jlarmstJ
tRPC15mo ago
3 replies
jlarmst

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,
    },
  );

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; }>>'.

tRPC version is 11.0.0-rc.571
Was this page helpful?