lassiterL
tRPC5mo ago
6 replies
lassiter

tRPC v11 with Tanstack React Query - queryOptions/mutationOptions methods missing

I'm migrating to the new Tanstack React Query integration for tRPC v11 in a Next.js 15 monorepo, but the queryOptions and mutationOptions
methods are not available on my tRPC utilities.

Setup:
- Next.js 15.3.5 with App Router
- tRPC v11.4.3
- @tanstack/react-query v5.79.0
- pnpm workspace monorepo

Issue:
    const utils = useTRPC();
    // ❌ Property 'queryOptions' does not exist
    utils.requests.list.queryOptions({...})


The procedures are being typed as any due to a TypeScript portability issue with Supabase types in our shared package. When I export
procedures without as any, the build fails with Supabase cookie type mismatches.

Has anyone encountered similar type inference issues across package boundaries in monorepos?

I've been trying to get a reproduction repo setup and this one is pretty close https://github.com/lassiter/tanstack-trpc-issue
GitHub
Contribute to lassiter/tanstack-trpc-issue development by creating an account on GitHub.
GitHub - lassiter/tanstack-trpc-issue
Was this page helpful?