\n\n\n\n### Link to reproduction\n\nNot Needed\n\n### To reproduce\n\nfetch an query on the server and the error type is messed up\n\n### Additional information\n\n_No response_\n\n### 👨👧👦 Contributing\n\n- [ ] 🙋♂️ Yes, I'd be down to file a PR fixing this bug!",[3185],{"name":3173,"color":3174},6956,"bug: since TRPC v11.5.0 errors on createTRPCOptionsProxy are broken and not typed properly","2025-09-22T23:38:43Z","https://github.com/trpc/trpc/issues/6956",0.6546425,{"description":3192,"labels":3193,"number":3194,"owner":3176,"repository":3176,"state":3195,"title":3196,"updated_at":3197,"url":3198,"score":3199},"### Provide environment information\r\n\r\n```\r\n\r\n System:\r\n OS: macOS 12.5.1\r\n CPU: (8) arm64 Apple M1\r\n Memory: 157.83 MB / 16.00 GB\r\n Shell: 5.8.1 - /bin/zsh\r\n Binaries:\r\n Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node\r\n Yarn: 1.22.19 - /opt/homebrew/bin/yarn\r\n npm: 8.19.1 - ~/.nvm/versions/node/v16.17.0/bin/npm\r\n Watchman: 2022.09.12.00 - /opt/homebrew/bin/watchman\r\n Browsers:\r\n Brave Browser: 106.1.44.105\r\n Chrome: 105.0.5195.125\r\n Firefox: 105.0.1\r\n Safari: 16.0\r\n npmPackages:\r\n @trpc/react: ^10.0.0-proxy-beta.15 => 10.0.0-proxy-beta.15\r\n react: 18.0.0 => 18.0.0 \r\n typescript: ~4.7.4 => 4.7.4 \r\n\r\n```\r\n\r\n### Describe the bug\r\n\r\nIf I create a trpc react proxy and client like:\r\n\r\n```typescript\r\nexport const trpc = createTRPCReact\u003CUserRouter>()\r\nexport const trpcClient: TRPCClient\u003CUserRouter> = trpc.createClient({\r\n links: [\r\n httpBatchLink({\r\n url: \"http://localhost:3000/user\"\r\n }),\r\n ],\r\n})\r\n```\r\n\r\nAnd try to use the `trpcClient` directly, it does not have the correct types:\r\n\r\n```typescript\r\n const createAccountResult = await trpcClient.mutation(\"account.create\")\r\n```\r\n\r\nWill return: `TS2345: Argument of type 'string' is not assignable to parameter of type 'never'.`\r\n\r\n### Link to reproduction\r\n\r\nhttps://stackblitz.com/github/trpc/examples-next-minimal-starter\r\n\r\n### To reproduce\r\n\r\nSee above\r\n\r\n### Additional information\r\n\r\n_No response_\r\n\r\n### 👨👧👦 Contributing\r\n\r\n- [X] 🙋♂️ Yes, I'd be down to file a PR fixing this bug!",[],2922,"closed","bug: `TRPCClient` from `createTRPCReact\u003CRouterType>().createClient` is incorrectly typed","2022-10-05T23:29:07Z","https://github.com/trpc/trpc/issues/2922",0.642806,{"description":3201,"labels":3202,"number":3206,"owner":3176,"repository":3176,"state":3195,"title":3207,"updated_at":3208,"url":3209,"score":3210},"Hi there,\r\n\r\nfirst of all: Thanks a lot for creating trpc :) I just recently stumpled upon it and I'm quite enthusiastic about it's design.\r\n\r\nNow to the problem:\r\n\r\nI'm trying to use trpc in a pnpm-driven monorepo. When I try to compile the package that's using trpc (both `@trpc/server` and `@trpc/client`), `tsc` fails with:\r\n\r\n```\r\n../../../../node_modules/.pnpm/@trpc+server@9.23.4/node_modules/@trpc/server/dist/declarations/src/adapters/node-http/types.d.ts:3:16 - error TS2307: Cannot find module 'qs' or its corresponding type declarations.\r\n\r\n3 import qs from 'qs';\r\n\r\n[...]\r\n\r\n../../../../node_modules/.pnpm/@trpc+server@9.23.4/node_modules/@trpc/server/dist/declarations/src/adapters/standalone.d.ts:5:107 - error TS2344: Type 'IncomingMessage' does not satisfy the constraint 'NodeHTTPRequest'.\r\n Type 'IncomingMessage' is not assignable to type '{ method?: string; query?: any; body?: unknown; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.\r\n Types of property 'method' are incompatible.\r\n Type 'string | undefined' is not assignable to type 'string'.\r\n Type 'undefined' is not assignable to type 'string'.\r\n\r\n5 export declare type CreateHTTPHandlerOptions\u003CTRouter extends AnyRouter> = NodeHTTPHandlerOptions\u003CTRouter, http.IncomingMessage, http.ServerResponse>;\r\n```\r\n\r\nThe first one\r\n```\r\nTS2307: Cannot find module 'qs' or its corresponding type declarations.\r\n```\r\n\r\ncan be fixed by installing `@types/qs`. However, I don't think that should be necessary.\r\n\r\nThe second one\r\n```\r\nTS2344: Type 'IncomingMessage' does not satisfy the constraint 'NodeHTTPRequest'.\r\n```\r\nisn't explicable to me but at least resembles one of the errors documented in #1022.\r\n\r\nThis issue was closed by #1151, which should be included with the trpc version I'm using (9.23.4).\r\n\r\nIt's possible that this is related to my use of pnpm.\r\n\r\nAny hint would be appreciated :) I'll keep you posted, if I find anything myself.",[3203],{"name":3204,"color":3205},"🐛 bug","d73a4a",1904,"Type Errors","2022-10-04T12:02:52Z","https://github.com/trpc/trpc/issues/1904",0.65084684,{"description":3212,"labels":3213,"number":3220,"owner":3176,"repository":3176,"state":3195,"title":3221,"updated_at":3222,"url":3223,"score":3224},"### Provide environment information\n\n System:\r\n OS: macOS 13.0\r\n CPU: (8) x64 Apple M1\r\n Memory: 16.57 MB / 16.00 GB\r\n Shell: 5.5.1 - /usr/local/bin/zsh\r\n Binaries:\r\n Node: 14.18.3 - ~/.nvm/versions/node/v14.18.3/bin/node\r\n Yarn: 1.22.19 - ~/.nvm/versions/node/v14.18.3/bin/yarn\r\n npm: 8.13.1 - ~/.nvm/versions/node/v14.18.3/bin/npm\r\n Browsers:\r\n Brave Browser: 87.1.18.75\r\n Chrome: 107.0.5304.110\r\n Firefox: 105.0.3\r\n Firefox Developer Edition: 76.0\r\n Safari Technology Preview: 16.4\r\n\n\n### Describe the bug\n\n ERROR ERROR in client.ts:5:45 05:06:06\r\nTS2344: Type 'Router\u003C{ _config: RootConfig\u003C{ ctx: any; meta: {}; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>; router: true; ... 5 more ...; isDev: boolean; }> & { ...; }' does not satisfy the constraint 'Router\u003CAnyRouterDef\u003CAnyRootConfig, any>>'.\r\n The types returned by 'createCaller(...)' are incompatible between these types.\r\n Type '{ query: inferHandlerFn\u003C{}>; mutation: inferHandlerFn\u003C{}>; subscription: inferHandlerFn\u003C{}>; } & DecoratedProcedureRecord\u003C{ exportReport: BuildProcedure\u003C\"query\", { ...; }, { ...; }>; }>' is not assignable to type '{ query: inferHandlerFn\u003Cany>; mutation: inferHandlerFn\u003Cany>; subscription: inferHandlerFn\u003Cany>; } & DecoratedProcedureRecord\u003Cany>'.\r\n Type '{ query: inferHandlerFn\u003C{}>; mutation: inferHandlerFn\u003C{}>; subscription: inferHandlerFn\u003C{}>; } & DecoratedProcedureRecord\u003C{ exportReport: BuildProcedure\u003C\"query\", { ...; }, { ...; }>; }>' is not assignable to type '{ query: inferHandlerFn\u003Cany>; mutation: inferHandlerFn\u003Cany>; subscription: inferHandlerFn\u003Cany>; }'.\r\n Types of property 'query' are incompatible.\r\n Type 'inferHandlerFn\u003C{}>' is not assignable to type 'inferHandlerFn\u003Cany>'.\r\n Types of parameters 'path' and 'path' are incompatible.\r\n Type 'TPath' is not assignable to type 'never'.\r\n Type 'string' is not assignable to type 'never'.\n\n### Link to reproduction\n\nNo link\n\n### To reproduce\n\nI don't know why it stopped working all of a sudden\n\n### Additional information\n\n_No response_\n\n### 👨👧👦 Contributing\n\n- [ ] 🙋♂️ Yes, I'd be down to file a PR fixing this bug!",[3214,3217],{"name":3215,"color":3216},"👻 invalid","e4e669",{"name":3218,"color":3219},"⏮ needs reproduction","000055",3202,"bug: not sure what happened, just broke all of a sudden","2022-11-19T21:47:15Z","https://github.com/trpc/trpc/issues/3202",0.65375113,{"description":3226,"labels":3227,"number":3228,"owner":3176,"repository":3176,"state":3195,"title":3229,"updated_at":3230,"url":3231,"score":3232},"### Provide environment information\r\n\r\n``` \r\nSystem:\r\n OS: macOS 12.2.1\r\n CPU: (10) arm64 Apple M1 Max\r\n Memory: 131.52 MB / 32.00 GB\r\n Shell: 3.2.57 - /bin/bash\r\n Binaries:\r\n Node: 18.8.0 - ~/.local/share/nvm/v18.8.0/bin/node\r\n Yarn: 1.22.19 - ~/.local/share/nvm/v18.8.0/bin/yarn\r\n npm: 8.18.0 - ~/.local/share/nvm/v18.8.0/bin/npm\r\n Browsers:\r\n Chrome: 106.0.5249.103\r\n Firefox: 105.0.2\r\n Safari: 15.3\r\n npmPackages:\r\n @trpc/client: ^10.0.0-proxy-beta.17 => 10.0.0-proxy-beta.17\r\n```\r\n\r\n\r\n### Describe the bug\r\n\r\nTypescript can't complete the typing of a query, see discussion https://github.com/trpc/trpc/discussions/2963\r\n\r\n\r\n`Property 'subscribe' does not exist on type 'DecoratedProcedureRecord\u003Cunknown, BuildProcedure\u003C\"subscription\", { _config: RootConfig\u003C{ ctx: {}; meta: {}; errorShape: never; transformer: CombinedDataTransformer; }>; _ctx_out: {}; _input_in: unique symbol; _input_out: unique symbol; _output_in: u\r\n nique symbol; _output_out: unique symbol; _meta: {}; }, Observable\u003C....'.`\r\n\r\n### Link to reproduction\r\n\r\nhttps://github.com/Lilja/trpc-v10-server-needed\r\n\r\n### To reproduce\r\n\r\nOpen up `src/index.ts` and modify the `type {AppRouter}` import, point it to the trpc repo OR a another router.\r\n\r\n### Additional information\r\n\r\n_No response_\r\n\r\n### 👨👧👦 Contributing\r\n\r\n- [ ] 🙋♂️ Yes, I'd be down to file a PR fixing this bug!",[],2972,"bug: @trpc/server needed in the frontend for types to work","2022-10-11T08:18:00Z","https://github.com/trpc/trpc/issues/2972",0.6615033,{"description":3234,"labels":3235,"number":3237,"owner":3176,"repository":3176,"state":3195,"title":3238,"updated_at":3239,"url":3240,"score":3241},"### Provide environment information\n\n```\n**System**\n- OS: macOS 14.5 (Darwin 23.6.0)\n- CPU: Apple Silicon (arm64)\n- Node: v18.20.4\n- Package Manager: pnpm 9.5.0\n- TypeScript: 5.8.3 (devDependency)\n- strict mode: true\n\n**Packages**\n- react: 18.3.1\n- @tanstack/react-query: 5.51.1\n- @trpc/server: 11.1.2\n- @trpc/client: 11.1.2\n```\n\n### Describe the bug\n\nEven with a fully typed AppRouter and a properly configured createTRPCOptionsProxy\u003CAppRouter>, calling:\n```\nuseQuery(trpc.shared.groupMember.getMemberships.queryOptions())\n```\nreturns a `UseQueryResult\u003Cunknown, Error>`, unless I explicitly annotate the type via `inferOutput`\n\n### Link to reproduction\n\nhttps://stackblitz.com/edit/github-5vf255ob?file=src%2Fpages%2Findex.tsx\n\n### To reproduce\n\nGiven the following in the backend:\n\n```ts\nexport const groupMemberRouter = t.router({\n getMemberships: protectedProcedure\n .output(zodGetMembershipsResponse) // ✅ Zod-typed output\n .query(async ({ ctx }) => { ... }),\n});\n```\n\nAnd in the frontend:\n\n```ts\nimport { createTRPCClient, httpBatchLink } from '@trpc/client';\nimport { createTRPCOptionsProxy } from '@trpc/tanstack-react-query';\nimport type { AppRouter } from '@myapp/server';\n\nconst trpcClient = createTRPCClient\u003CAppRouter>({ ... });\n\nexport const trpc = createTRPCOptionsProxy\u003CAppRouter>({\n client: trpcClient,\n queryClient,\n});\n```\n\nI use it like this:\n\n```ts\nconst memberships = useQuery(\n trpc.shared.groupMember.getMemberships.queryOptions()\n);\n```\n\nBut I get:\n\n```ts\nUseQueryResult\u003Cunknown, Error> ❌\n```\n\nInstead, I must do:\n\n```ts\nimport type { inferOutput } from '@trpc/tanstack-react-query';\n\ntype Output = inferOutput\u003Ctypeof trpc.shared.groupMember.getMemberships>;\n\nconst memberships = useQuery\u003COutput>(\n trpc.shared.groupMember.getMemberships.queryOptions()\n);\n```\n\nAnd now `memberships.data` is fully typed.\n\n---\n* Hovering over `.queryOptions()` correctly shows the `output` type.\n* Hovering over `getMemberships` shows the correct `DecorateQueryProcedure\u003C{ input, output, transformer, ... }>` structure.\n* Yet, `useQuery(...)` **without manual annotation** fails to infer the result type.\n---\n\nIs this expected (i.e., `queryOptions()` is not supposed to support full inference in `useQuery()` directly)? Or is this a bug or a missing generic inference?\n\nThanks for all the work!\n\n### Additional information\n\n_No response_\n\n### 👨👧👦 Contributing\n\n- [ ] 🙋♂️ Yes, I'd be down to file a PR fixing this bug!",[3236],{"name":3173,"color":3174},6852,"bug:","2025-07-10T23:08:45Z","https://github.com/trpc/trpc/issues/6852",0.6621399,{"description":3243,"labels":3244,"number":3245,"owner":3176,"repository":3176,"state":3195,"title":3246,"updated_at":3247,"url":3248,"score":3249},"### Provide environment information\r\n\r\n```\r\n System:\r\n OS: macOS 12.4\r\n CPU: (8) arm64 Apple M1 Pro\r\n Memory: 243.75 MB / 16.00 GB\r\n Shell: 5.8.1 - /bin/zsh\r\n Binaries:\r\n Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node\r\n Yarn: 1.22.19 - ~/.yarn/bin/yarn\r\n npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm\r\n Browsers:\r\n Chrome: 104.0.5112.79\r\n Firefox: 103.0\r\n Safari: 15.5\r\n npmPackages:\r\n @tanstack/react-query: ^4.1.0 => 4.1.0\r\n @trpc/client: ^10.0.0-alpha.45 => 10.0.0-katt-fix-error-inference-2022-08-10-15-04-30.0+bd693740\r\n @trpc/next: ^10.0.0-alpha.45 => 10.0.0-katt-fix-error-inference-2022-08-10-15-04-30.0+bd693740\r\n @trpc/react: ^10.0.0-alpha.45 => 10.0.0-katt-fix-error-inference-2022-08-10-15-04-30.0+bd693740\r\n @trpc/server: ^10.0.0-alpha.45 => 10.0.0-katt-fix-error-inference-2022-08-10-15-04-30.0+bd693740\r\n next: 12.2.4 => 12.2.4\r\n react: 18.2.0 => 18.2.0\r\n```\r\n\r\n### Describe the bug\r\n\r\nWhen calling queries on the server using `router.createCaller`, then returning it to the client through `getStaticProps`, the data fails to serialize if it contains e.g. `Date` and throws the following error:\r\n```\r\nError: Error serializing `.twitterFeed[0].createdAt` returned from `getStaticProps` in \"/\".\r\nReason: `object` (\"[object Date]\") cannot be serialized as JSON. Please only return JSON serializable data types.\r\n```\r\n\r\n### To reproduce\r\n\r\n```ts\r\nexport const getStaticProps = async () => {\r\n const caller = appRouter.createCaller({});\r\n const twitterFeed = await caller.twitter.feed();\r\n // ^? void | { createdAt: Date, ... }\r\n return { props: { twitterFeed }, revalidate: 3600 };\r\n};\r\n\r\nconst FeedPage: NextPage\u003CInferGetStaticPropsType\u003Ctypeof getStaticProps>> = ({\r\n twitterFeed,\r\n}) => {\r\n return \u003CTwitterFeed feed={twitterFeed} />;\r\n};\r\nexport default FeedPage;\r\n```\r\n\r\n### Additional information\r\n\r\nRelated PR: https://github.com/trpc/trpc/pull/2233\r\n\r\nReason I would like to do this is to use Next.js's ISR and fetch the feed on the server at some intervals.\r\n\r\n### 👨👧👦 Contributing\r\n\r\n- [ ] 🙋♂️ Yes, I'd be down to file a PR fixing this bug!",[],2440,"bug: server side calls not serializing non-json types","2022-10-04T00:18:19Z","https://github.com/trpc/trpc/issues/2440",0.66464716,{"description":3251,"labels":3252,"number":3254,"owner":3176,"repository":3176,"state":3195,"title":3255,"updated_at":3256,"url":3257,"score":3258},"### Provide environment information\r\n\r\n```\r\n System:\r\n OS: macOS 13.4\r\n CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz\r\n Memory: 2.55 GB / 32.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 16.19.1 - ~/Library/Caches/fnm_multishells/55125_1686318295579/bin/node\r\n npm: 8.19.3 - ~/Library/Caches/fnm_multishells/55125_1686318295579/bin/npm\r\n Browsers:\r\n Chrome: 114.0.5735.106\r\n Firefox: 113.0.2\r\n Safari: 16.5\r\n npmPackages:\r\n @tanstack/react-query: 4.29.12 => 4.29.12 \r\n @trpc/client: 10.29.1 => 10.29.1 \r\n @trpc/react-query: 10.29.1 => 10.29.1 \r\n @trpc/server: 10.29.1 => 10.29.1 \r\n react: 18.2.0 => 18.2.0 \r\n typescript: 5.1.3 => 5.1.3 \r\n```\r\n\r\n### Describe the bug\r\n\r\nSome kind of type conflict between `undici` `fetch` implementation and the latest `trpc` versions.\r\n\r\nEverything worked on v10.28.2. Breaking thereafter.\r\n\r\n\r\n\r\n### Link to reproduction\r\n\r\nhttps://stackblitz.com/edit/github-6ymtpz?file=src%2Fserver%2Ftrpc.ts\r\n\r\n### To reproduce\r\n\r\nSee stackblitz link for repro.\r\n\r\n### Additional information\r\n\r\n```\r\nArgument of type '(input: RequestInfo, init?: RequestInit | undefined) => Promise\u003CResponse>' is not assignable to parameter of type 'FetchEsque | NativeFetchEsque | undefined'.\r\n Type '(input: RequestInfo, init?: RequestInit | undefined) => Promise\u003CResponse>' is not assignable to type 'FetchEsque'.\r\n Types of parameters 'input' and 'input' are incompatible.\r\n Type 'RequestInfo | URL' is not assignable to type 'RequestInfo'.\r\n Type 'Request' is not assignable to type 'RequestInfo'.\r\n Property 'duplex' is missing in type 'Request' but required in type 'import(\"stackblitz:/node_modules/undici/types/fetch\").Request'.(2345)\r\n```\r\n\r\n### 👨👧👦 Contributing\r\n\r\n- [ ] 🙋♂️ Yes, I'd be down to file a PR fixing this bug!",[3253],{"name":3204,"color":3205},4504,"bug: Type 'Request' is not assignable to type 'RequestInfo', Property 'duplex' is missing in type 'Request'","2025-03-20T15:41:42Z","https://github.com/trpc/trpc/issues/4504",0.66941124,{"description":3260,"labels":3261,"number":3263,"owner":3176,"repository":3176,"state":3195,"title":3264,"updated_at":3265,"url":3266,"score":3267},"### Provide environment information\r\n\r\n System:\r\n OS: Linux 5.10 Ubuntu 20.04.4 LTS (Focal Fossa)\r\n CPU: (16) x64 AMD Ryzen 7 5800X 8-Core Processor\r\n Memory: 22.88 GB / 24.99 GB\r\n Container: Yes\r\n Shell: 5.8 - /usr/bin/zsh\r\n Binaries:\r\n Node: 16.16.0 - ~/.local/state/fnm_multishells/51_1669587048149/bin/node\r\n Yarn: 1.22.19 - ~/.local/state/fnm_multishells/51_1669587048149/bin/yarn\r\n npm: 8.11.0 - ~/.local/state/fnm_multishells/51_1669587048149/bin/npm\r\n npmPackages:\r\n @tanstack/react-query: ^4.18.0 => 4.18.0\r\n @trpc/client: ^10.4.0 => 10.4.0\r\n @trpc/next: ^10.4.0 => 10.4.0\r\n @trpc/react-query: ^10.4.0 => 10.4.0\r\n @trpc/server: ^10.4.0 => 10.4.0\r\n next: 12.3.1 => 12.3.1\r\n react: 18.2.0 => 18.2.0\r\n typescript: 4.7.4 => 4.7.4\r\n\r\n### Describe the bug\r\n\r\nTS infers the wrong type on serializable fields on v9 queries.\r\n\r\nIG: if a query returns a `Date` field. A client call to `trpc.useQuery` for that query the corresponding field in `data` is inferred as string rather than Date.\r\n\r\n### Link to reproduction\r\n\r\nhttps://github.com/lakardion/trpc-v9-v10\r\n\r\n### To reproduce\r\n\r\nCheck on https://github.com/lakardion/trpc-v9-v10/blob/642c9042e140cf6d2e769885680d13339c7bd2d7/src/pages/index.tsx#L21\r\n\r\n`hello.myDate` should be of type `Date | undefined` instead, it is inferred as `string`.\r\n\r\nIf you run the project you can see that the serialization is actually occurring since the type of `hello.myDate` is object\r\n\r\n### Additional information\r\n\r\n_No response_\r\n\r\n### 👨👧👦 Contributing\r\n\r\n- [ ] 🙋♂️ Yes, I'd be down to file a PR fixing this bug!",[3262],{"name":3204,"color":3205},3303,"bug: v9-v10 interop TS does not consider superjson's serialization when using v9 query in client","2022-12-08T12:31:05Z","https://github.com/trpc/trpc/issues/3303",0.67360306,["Reactive",3269],{},["Set"],["ShallowReactive",3272],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fdtWc-dYYJGSD2UOlBdYZIVgnYgaTkBSaRHpXsV1Owl0":-1},"/trpc/trpc/3307"]