\n\n### Link to reproduction\n\nhttps://stackblitz.com/github/trpc/examples-next-minimal-starter\n\n### To reproduce\n\nCan attempt repro if the stack trace provided is not enough\n\n### Additional information\n\n_No response_\n\n### ๐จโ๐งโ๐ฆ Contributing\n\n- [x] ๐โโ๏ธ Yes, I'd be down to file a PR fixing this bug!",[2867,2870,2873],{"name":2868,"color":2869},"๐โโ๏ธ help wanted","008672",{"name":2871,"color":2872},"โฎ needs reproduction","000055",{"name":2874,"color":2875},"๐ bug: unconfirmed","e99695",6533,"trpc","open","bug: Potential memory leak in streaming with v11","2025-02-28T15:50:08Z","https://github.com/trpc/trpc/issues/6533",0.75980633,{"description":2884,"labels":2885,"number":2887,"owner":2877,"repository":2877,"state":2878,"title":2888,"updated_at":2889,"url":2890,"score":2891},"### Provide environment information\n\n```\n System:\n OS: Windows 11 10.0.26100\n CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13700H\n Memory: 8.36 GB / 31.64 GB\n Binaries:\n Node: 22.14.0 - ~\\AppData\\Local\\fnm_multishells\\15936_1748944527810\\node.EXE\n pnpm: 10.11.1 - ~\\AppData\\Local\\fnm_multishells\\15936_1748944527810\\pnpm.CMD\n Browsers:\n Edge: Chromium (130.0.2849.56)\n Internet Explorer: 11.0.26100.1882\n npmPackages:\n @trpc/client: ^11.2.0 => 11.2.0\n @trpc/server: ^11.2.0 => 11.2.0\n typescript: ^5.8.3 => 5.8.3\n zod: ^3.25.49 => 3.25.49\n```\n\n### Describe the bug\n\nWhen defining `z. json()` schema from `zod/v4` as the return value in the output option of the trpc procedure, I will see an error from the IDE stating 'Type instantiation is excessively deep and possibly infinite' when using it.\n\n\n\n### Link to reproduction\n\nhttps://github.com/YKDZ/trpc-zod-v4-type-infinite\n\n### To reproduce\n\n1. clone repo and run `pnpm install`\n2. open `test.ts`\n3. wait and see the error\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!",[2886],{"name":2874,"color":2875},6804,"bug: Use zod v4 json schema cause type infinite error","2025-06-03T11:26:37Z","https://github.com/trpc/trpc/issues/6804",0.7940478,{"description":2893,"labels":2894,"number":2895,"owner":2877,"repository":2877,"state":2878,"title":2896,"updated_at":2897,"url":2898,"score":2899},"### Describe the feature you'd like to request\r\n\r\nMetadata is extremely useful for documenting procedures. However so far as I can tell, it isn't possible to add metadata to a router. This makes it impossible to document tRPC routers as well as is possible with a standard rest API, as there is no way to add the equivalent of a description to a [tag object](https://spec.openapis.org/oas/latest.html#tag-object).\r\n\r\n\r\n\r\n### Describe the solution you'd like to see\r\n\r\nSomething like this:\r\n\r\n```typescript\r\nconst petRouter = t.meta({ description: \"router description\" }).router({\r\n get: t.procedure.meta({ description: \"procedure description\" }).query(() => {\r\n return \"my pet\";\r\n })\r\n});\r\n```\r\n\r\nWould help improve packages like https://github.com/dtinth/openapi-trpc or (selfishly) https://github.com/aidansunbury/trpc-ui\r\n\r\n### Describe alternate solutions\r\n\r\nA hacky workaround I have been messing around with is to just add an empty procedure to the router, which just has to be parsed by whatever tool is being used to generate documentation.\r\n\r\n```typescript\r\nconst petRouter = t.router({\r\n\tmeta: t.procedure.meta({ description: \"This procedure's metadata could be elevated to the route level\" }).query(() => null),\r\n get: t.procedure.meta({ description: \"procedure description\" }).query(() => {\r\n return fakeData.user;\r\n })\r\n});\r\n```\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 implementing this feature!\r\n\r\nEspecially if it is something more people than just myself would use!",[],6242,"feat: Router level metadata","2025-03-20T15:42:42Z","https://github.com/trpc/trpc/issues/6242",0.79758066,{"description":2901,"labels":2902,"number":2903,"owner":2877,"repository":2877,"state":2904,"title":2905,"updated_at":2906,"url":2907,"score":2908},"### Provide environment information\r\n\r\n```\r\n System:\r\n OS: macOS 13.4.1\r\n CPU: (8) arm64 Apple M1\r\n Memory: 223.42 MB / 16.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node\r\n Yarn: 1.22.19 - ~/.nvm/versions/node/v18.16.0/bin/yarn\r\n npm: 9.8.1 - ~/.nvm/versions/node/v18.16.0/bin/npm\r\n pnpm: 8.6.6 - ~/.nvm/versions/node/v18.16.0/bin/pnpm\r\n Browsers:\r\n Brave Browser: 115.1.56.14\r\n Safari: 16.5.2\r\n npmPackages:\r\n @tanstack/react-query: ^4.18.0 => 4.32.1 \r\n @trpc/client: ^10.36.0 => 10.36.0 \r\n @trpc/next: ^10.36.0 => 10.36.0 \r\n @trpc/react-query: ^10.36.0 => 10.36.0 \r\n @trpc/server: ^10.36.0 => 10.36.0 \r\n next: ^13.4.8 => 13.4.12 \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\nWhile using [https://github.com/trpc/trpc/tree/main/examples/next-prisma-todomvc](next-prisma-todomvc) reproduction everything seems to be working fine, however, when I do first request httpUtils gets this error:\r\n\r\n```\r\n \u003C\u003C query #1 user.all {\r\n input: undefined,\r\n result: TRPCClientError: Unexpected token \u003C in JSON at position 0\r\n at TRPCClientError.from (file:///Volumes/DEV/ulobo/node_modules/@trpc/client/dist/TRPCClientError-fef6cf44.mjs:26:16)\r\n at file:///Volumes/DEV/ulobo/node_modules/@trpc/client/dist/httpUtils-ad76b802.mjs:125:36\r\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {\r\n meta: { response: [Response] },\r\n shape: undefined,\r\n data: undefined,\r\n [cause]: SyntaxError: Unexpected token \u003C in JSON at position 0\r\n at JSON.parse (\u003Canonymous>)\r\n at parseJSONFromBytes (node:internal/deps/undici/undici:6571:19)\r\n at successSteps (node:internal/deps/undici/undici:6545:27)\r\n at node:internal/deps/undici/undici:1211:60\r\n at node:internal/process/task_queues:140:7\r\n at AsyncResource.runInAsyncScope (node:async_hooks:203:9)\r\n at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)\r\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\r\n },\r\n elapsedMs: 61\r\n}\r\nTRPCClientError: Unexpected token \u003C in JSON at position 0\r\n at TRPCClientError.from (file:///Volumes/DEV/ulobo/node_modules/@trpc/client/dist/TRPCClientError-fef6cf44.mjs:26:16)\r\n at file:///Volumes/DEV/ulobo/node_modules/@trpc/client/dist/httpUtils-ad76b802.mjs:125:36\r\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {\r\n meta: {\r\n response: Response {\r\n [Symbol(realm)]: null,\r\n [Symbol(state)]: [Object],\r\n [Symbol(headers)]: [HeadersList]\r\n }\r\n },\r\n shape: undefined,\r\n data: undefined,\r\n [cause]: SyntaxError: Unexpected token \u003C in JSON at position 0\r\n at JSON.parse (\u003Canonymous>)\r\n at parseJSONFromBytes (node:internal/deps/undici/undici:6571:19)\r\n at successSteps (node:internal/deps/undici/undici:6545:27)\r\n at node:internal/deps/undici/undici:1211:60\r\n at node:internal/process/task_queues:140:7\r\n at AsyncResource.runInAsyncScope (node:async_hooks:203:9)\r\n at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)\r\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\r\n}\r\n```\r\n\r\n\r\n\r\n### Link to reproduction\r\n\r\nhttps://github.com/porydzaj/trpc-404-httputils\r\n\r\n### To reproduce\r\n\r\nRun first fetch at index with utils/trpc\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!",[],4671,"closed","bug: Unexpected token \u003C in JSON at position 0","2025-03-20T15:41:49Z","https://github.com/trpc/trpc/issues/4671",0.7228844,{"description":2910,"labels":2911,"number":2916,"owner":2877,"repository":2877,"state":2904,"title":2917,"updated_at":2918,"url":2919,"score":2920},"### Provide environment information\n\nSystem:\n OS: macOS 15.0.1\n CPU: (8) arm64 Apple M1 Pro\n Memory: 101.39 MB / 16.00 GB\n Shell: 5.9 - /bin/zsh\n Binaries:\n Node: 20.18.1 - ~/.nvm/versions/node/v20.18.1/bin/node\n Yarn: 4.6.0 - ~/.nvm/versions/node/v20.18.1/bin/yarn\n npm: 10.8.2 - ~/.nvm/versions/node/v20.18.1/bin/npm\n bun: 1.2.0 - ~/.bun/bin/bun\n Watchman: 2024.11.04.00 - /opt/homebrew/bin/watchman\n Browsers:\n Chrome: 133.0.6943.127\n Safari: 18.0.1\n npmPackages:\n @trpc/client: ^11.0.0-rc.791 => 11.0.0-rc.791+4eda4d50f\n @trpc/server: ^11.0.0-rc.791 => 11.0.0-rc.791+4eda4d50f\n typescript: ^5.7.3 => 5.7.3\n\n### Describe the bug\n\nWhen using TRPC v11 with the Express adapter, the input received on server (serialized by supersjon on client) can't be correctly deserialized by superjson (eg: Date remains string). By diving into superjson's code, it seems this equality is not met https://github.com/flightcontrolhq/superjson/blob/main/src/is.ts#L16. When creating the exact same input into the transformer (on server side), it works as intended, example : \n```ts\ntransformer: {\n input: {\n serialize: superjson.serialize,\n deserialize: (data: any) => {\n // Artificial input copy\n const foo = {\n \"json\": {\n \"date\": \"2025-02-21T09:33:09.469Z\"\n },\n \"meta\": {\n \"values\": {\n \"date\": [\n \"Date\"\n ]\n }\n }\n }\n\n // Here, date will be transformed into date\n console.log(superjson.deserialize(foo));\n\n // Here, date will not be transformed into date\n return superjson.deserialize(data);\n },\n },\n output: {\n serialize: superjson.serialize,\n deserialize: superjson.deserialize,\n },\n },\n```\n\nIt seems this behaviour appeared in 11.0.0-rc.362, it worked fine on 11.0.0-rc.361 and below.\n\n### Link to reproduction\n\nhttps://github.com/emileNetter/trpc-superjson-repro\n\n### To reproduce\n\n```bash\ncorepack enable\nyarn install\nyarn test\n```\n\nThe test fails because the date can't be converted to Date and zod schema throws an error.\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!",[2912,2913],{"name":2874,"color":2875},{"name":2914,"color":2915},"โณ close if no activity","d4c5f9",6540,"bug: input can't be deserialized by superjson with express adapter","2025-03-18T00:08:02Z","https://github.com/trpc/trpc/issues/6540",0.76187176,{"description":2922,"labels":2923,"number":2927,"owner":2877,"repository":2928,"state":2904,"title":2929,"updated_at":2930,"url":2931,"score":2932},"Hi there,\r\n\r\nThank you for taking the time to put this library together! I just came across an issue when opening the swagger UI - I see errors like so:\r\n\r\n```\r\nCould not resolve reference: #/properties/data/properties/id\r\n```\r\n\r\nFrom looking through the source, it looks like the `zod-to-json-schema` refStrategy (root is the default) is not mapping correctly. Maybe because the entire object is not being passed into the function?",[2924],{"name":2925,"color":2926},"bug","ff3333",37,"trpc-openapi","Schema $refs are not pointing correctly","2022-09-05T09:56:16Z","https://github.com/trpc/trpc-openapi/issues/37",0.766523,{"description":2934,"labels":2935,"number":2939,"owner":2877,"repository":2877,"state":2904,"title":2940,"updated_at":2941,"url":2942,"score":2943},"I have separated libs for client and server, and since @trpc/client doesn't export the observable function and type I also have to install @trpc/server just to use this function and type, which is weird. I think this function should be exported in both packages.",[2936],{"name":2937,"color":2938},"wontfix","ffffff",6013,"feat: @trpc/client should export observable","2024-09-25T12:03:09Z","https://github.com/trpc/trpc/issues/6013",0.7705713,{"description":2945,"labels":2946,"number":2953,"owner":2877,"repository":2877,"state":2904,"title":2954,"updated_at":2955,"url":2956,"score":2957},"### Area of Improvement\r\n\r\nThe Install dependencies section (https://trpc.io/docs/client/react/setup#1-install-dependencies)\r\n\r\nIs listing \r\n`npm install @trpc/server@next @trpc/client@next @trpc/react-query@next @trpc/next@next @tanstack/react-query@latest`\r\n\r\nI believe `@trpc/next@next` should not be included, as this is not anything related to Next?\r\n\r\nI'm not sure, but is `@trpc/server@next` also not required? I tested not installing it and got no errors whatsoever\r\n\r\n### Link to related docs\r\n\r\nhttps://trpc.io/docs/client/react/setup\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 implementing the suggested changes!",[2947,2950],{"name":2948,"color":2949},"๐ documentation / examples","0075ca",{"name":2951,"color":2952},"โ
accepted-PRs-welcome","0052cc",5588,"docs: v11 React Query Integration \"Install dependencies\" section lists unnecessary packages","2025-03-20T15:42:19Z","https://github.com/trpc/trpc/issues/5588",0.778744,{"description":2959,"labels":2960,"number":2961,"owner":2877,"repository":2877,"state":2904,"title":2962,"updated_at":2963,"url":2964,"score":2965},"### Describe the feature you'd like to request\r\n\r\nNB: I'm brand new to trpc, please let me know if this is irrelevant `:)\r\n\r\nIt would be great to be able to stream back parts of result as they become available. Example use cases:\r\n\r\n* Very large queries (of an array of objects), rather than waiting to complete retrieval and send all at once to client.\r\n* Long running tasks, to send strongly typed status messages and task info during the task run.\r\n\r\nTo be clear, I know it's already possible to use `BatchStreamLink` to perform multiple queries and stream the results back of each as they become available. But that's still waits for an individual query to complete. If e.g. a query will contain an array of objects, I want to stream each object back as soon as it's ready, without waiting for the entire array.\r\n\r\n### Describe the solution you'd like to see\r\n\r\nStill thinking this through, but something along the lines of:\r\n\r\n**server.ts**\r\n\r\n```ts\r\n// import { StreamingOutput } from...\r\n\r\nexport const appRouter = t.router({\r\n test: t.procedure.query(() => {\r\n return new StreamingOutput(async (stream) => {\r\n for (let i=0; i \u003C 5; i++) {\r\n stream.emit({ i });\r\n await sleep(1000);\r\n }\r\n stream.close();\r\n }\r\n});\r\n```\r\n\r\n**client.ts**\r\n\r\n```ts\r\nconst client = createTRPCProxyClient\u003CAppRouter>({\r\n links: [ httpStreamingLink(/*.../*) ] // \u003C-- new\r\n});\r\n\r\nconst stream = await client.test.query();\r\n\r\n// as event emitter\r\nstream.on(\"data\", data => doSomethingWith(data));\r\n\r\n// as iterator\r\nfor (const data of stream)\r\n doSomethingWith(data);\r\n```\r\n\r\n### Describe alternate solutions\r\n\r\nI guess there's a more convoluted way of doing this with subscriptions? Or maybe there is another good way but as a new user I don't understand it `:)\r\n\r\n### Additional information\r\n\r\nI apologise for this kind of weird situation where I'm completely new to the project and suggesting new features. I was about to implement something like this in our own internal tooling (which is very similar to tRPC), and thought this could be a good opportunity to rather swap it out for something more maintainable and contribute to the wider community.\r\n\r\nCould I flesh something out as a proof-of-concept? After I have something working, I'd then be grateful for further guidance and love to work together to make it feel more tRPC-like if I miss anything. What do you think?\r\n\r\n*Edit*: Clarify `httpStreamingLink()` in client.\r\n\r\n### ๐จโ๐งโ๐ฆ Contributing\r\n\r\n- [X] ๐โโ๏ธ Yes, I'd be down to file a PR implementing this feature!",[],6050,"feat: streaming array response (to contribute?)","2025-03-20T15:42:35Z","https://github.com/trpc/trpc/issues/6050",0.77882075,{"description":2967,"labels":2968,"number":2969,"owner":2877,"repository":2877,"state":2904,"title":2970,"updated_at":2971,"url":2972,"score":2973},"### Provide environment information\r\n\r\n```\r\n System:\r\n OS: macOS 12.5\r\n CPU: (10) arm64 Apple M1 Pro\r\n Memory: 2.67 GB / 32.00 GB\r\n Shell: 5.8.1 - /bin/zsh\r\n\r\n Binaries:\r\n Node: 16.18.1 - ~/.nvm/versions/node/v16.18.1/bin/node\r\n npm: 8.19.2 - ~/.nvm/versions/node/v16.18.1/bin/npm\r\n\r\n Browsers:\r\n Chrome: 108.0.5359.124\r\n Safari: 15.6\r\n\r\n npmPackages (Server):\r\n @trpc/server: ^10.4.3 => 10.4.3 \r\n typescript: ^4.9.4 => 4.9.4\r\n\r\n npmPackages (Client):\r\n @tanstack/react-query: ^4.19.1 => 4.19.1 \r\n @trpc/client: ^10.4.3 => 10.4.3 \r\n @trpc/react-query: ^10.4.3 => 10.4.3 \r\n @trpc/server: ^10.4.3 => 10.4.3 \r\n react: ^18.2.0 => 18.2.0 \r\n typescript: ^4.9.4 => 4.9.4\r\n```\r\n\r\n\r\n### Describe the bug\r\n\r\nHey guys,\r\n\r\nFirst of all, thanks for the awesome package, it's been revolutionizing the way we write React apps. \r\n\r\nNot sure if this is a known issue, but return types of queries (and not only) in the client result in `any` when using non-relative (either absolute or TS aliased paths) imports on the server. I supposed it is a bug, since I did not find the docs mentioning relative paths are required.\r\n\r\nActually, if you change the import of the whole `entitiesRouter` to be non-relative (see example and description below), it will return an object of type `any` for `trpc.entities` in the client. So the issue is not only for queries but for anything that is not imported with a relative path in `trpc`.\r\n\r\nThis is kind of frustrating for us, since it requires us to use relative imports pretty much everywhere in the project and it can easily result in a relative imports hell.\r\n\r\nE.g.\r\n`import { A } from '../../../../../../wherever/whatever';`\r\n\r\nIs there a workaround for this and what would it be?\r\n\r\nApologies if this has been asked and answered, I searched through the issues and the docs, but did not find anything.\r\n\r\nRegards,\r\nDelyan\r\n\r\n### Link to reproduction\r\n\r\nhttps://github.com/delyan-peev/trpc-relative-paths-bug\r\n\r\n### To reproduce\r\n\r\n1. Run `npm install` in both the `api-server` and `client` directories.\r\n2. Run `npx prisma generate client` in the `api-server` directory.\r\n3. Observe the returned type of the data property in `client/src/Test.tsx`\r\n4. Change the `import { prisma } from 'prisma';` line in `api-server/routers/entitiesRouter.ts` to `import { prisma } from '../prisma';`\r\n5. Observe the returned type of the data property in `client/src/Test.tsx`\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!",[],3475,"bug: Procedure return types result in `any` when using non-relative import paths","2022-12-24T16:08:44Z","https://github.com/trpc/trpc/issues/3475",0.78169763,["Reactive",2975],{},["Set"],["ShallowReactive",2978],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fYl5sEboOh3uIdUoFLclvw2OiS8stI4txRSkd14iKhT4":-1},"/trpc/trpc/4322"]