\n\n### Link to reproduction\n\nhttps://trpc.io/\n\n### To reproduce\n\nGo to https://trpc.io/, select the react option under 'Try it out for yourself', emamine the types in Greeting.tsx\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!",[3038,3041],{"name":3039,"color":3040},"blocked","111111",{"name":3042,"color":3043},"๐ bug: unconfirmed","e99695",6521,"bug: Type error in homepage demo of new tanstack query client","2025-03-12T13:50:30Z","https://github.com/trpc/trpc/issues/6521",0.7699709,{"description":3050,"labels":3051,"number":3052,"owner":3029,"repository":3053,"state":3030,"title":3054,"updated_at":3055,"url":3056,"score":3057},"Hey!\r\n\r\n@jlalmes is no longer maintaining this repo - but we're happy if someone wants to take over the maintence burden.\r\n\r\nContact us [on Discord](https://trpc.io/discord) - feel free to `@` me there.",[],463,"trpc-openapi","Repo archived (for now) - maintainers needed","2024-11-19T18:04:03Z","https://github.com/trpc/trpc-openapi/issues/463",0.7741747,{"description":3059,"labels":3060,"number":3061,"owner":3029,"repository":3053,"state":3030,"title":3062,"updated_at":3063,"url":3064,"score":3065},"Hello :)\r\n\r\nI see you've recently added support for adding examples. Would it be possible to support the `examples` key in addition to `example`. (singular vs plural). \r\n\r\nBoth are valid in the OpenApi spec: https://swagger.io/docs/specification/adding-examples/\r\n\r\nCheers ",[],420,"Support for examples key","2023-11-04T05:10:01Z","https://github.com/trpc/trpc-openapi/issues/420",0.7963016,{"description":3067,"labels":3068,"number":3072,"owner":3029,"repository":3029,"state":3030,"title":3073,"updated_at":3074,"url":3075,"score":3076},"### Area of Improvement\n\nThe usage example makes it seem like only multiple requests for the same sub router and procedure will be batched together. This is not the case in Next.js though.\n\n### Link to related docs\n\nhttps://trpc.io/docs/links/httpBatchLink\n\n### Additional information\n\nThe usage example shows requests from the same sub router procedure with different query inputs which is fine, but it probably needs to be mentioned that all requests from a functional component, regardless of if they are for the same sub router and procedure, will be batched together. This may actually be a bug, but it's happening in this package version combination\r\n\r\n@tanstack/react-query: ^4.24.9 => 4.24.9 \r\n@trpc/client: ^10.12.0 => 10.12.0 \r\n@trpc/next: ^10.12.0 => 10.12.0 \r\n@trpc/react-query: ^10.12.0 => 10.12.0 \r\n@trpc/server: ^10.12.0 => 10.12.0 \r\nnext: ^13.1.1 => 13.1.1 \r\nreact: ^18.2.0 => 18.2.0 \r\ntypescript: ^4.9.4 => 4.9.4\n\n### ๐จโ๐งโ๐ฆ Contributing\n\n- [ ] ๐โโ๏ธ Yes, I'd be down to file a PR implementing the suggested changes!\n\n\u003Csub>[TRP-51](https://linear.app/trpc/issue/TRP-51/docs-httpbatchlink-usage-example-comes-across-ambiguous)\u003C/sub>",[3069],{"name":3070,"color":3071},"๐ documentation / examples","0075ca",3847,"docs: httpBatchLink usage example comes across ambiguous","2025-03-20T15:41:34Z","https://github.com/trpc/trpc/issues/3847",0.7987342,{"description":3078,"labels":3079,"number":3086,"owner":3029,"repository":3029,"state":3030,"title":3087,"updated_at":3088,"url":3089,"score":3090},"### Describe the feature you'd like to request\r\n\r\nI think the fetch's design is better in terms of error handling, since typescript cannot type errors. So catching an error is not type-safe.\r\n\r\n> It returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that resolves to the [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) to that request โ as soon as the server responds with headers โ **even if the server response is an HTTP error status.** - https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API\r\n\r\nIf I send a 400 status code because the email is already set on a registration page, I cannot easily propagate the error back to the email input field, because tRPC can only type the 200 status.\r\n\r\nI built a similar setup to tRPC before I found it, and I think I handled the errors better. In my case the return type was a [discriminated union](https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html#discriminating-unions) of every possible response that the backend can send, including Internal Server Error, if the client wanted to handle that case.\r\n\r\nI think it is an anti-pattern to use nature js errors in typescript. Sometimes throwing is useful, but it's not a safe thing to do. And I would like safety.\r\n\r\nIn my case, I defined the controllers like this:\r\n```ts\r\nexport const authByAuthenticator = withResponse(async (req) => {\r\n const data = AuthByAuthenticator.schema.parse(req.body)\r\n const authResult = await authenticatorAuthService.authByAuthenticator(\r\n req.user.email,\r\n data.token\r\n )\r\n switch (authResult.result) {\r\n case 'accessDenied':\r\n return unauthorizedError()\r\n case 'wrongTOTP':\r\n return zodValidationError([\r\n {\r\n code: 'custom',\r\n path: ['token'],\r\n message: 'Wrong OTP'\r\n }\r\n ])\r\n case 'success':\r\n await authOTPLimit.resolve(req)\r\n return success({\r\n token: authResult.token,\r\n message: 'Good OTP, redirecting...'\r\n })\r\n }\r\n})\r\n```\r\n\r\n\r\n### Describe the solution you'd like to see\r\n\r\nI would like to have a way to return something like this:\r\n\r\n```ts\r\nif(somethingElse)\r\n return {\r\n statusCode: 400,\r\n result: 'somethingElse' as const,\r\n somethingElseThatExistsOnlyThisCase: 123\r\n // ...\r\n }\r\n \r\nreturn {\r\n statusCode: 200,\r\n result: 'success' as const,\r\n somethingThatExistsOnlyThisCase: 42\r\n // ...\r\n}\r\n``` \r\n\r\nAnd I would like to get this back clientside, as well when the status is not 200\r\n```ts\r\nif(response.result === 'success') {\r\n console.log(response.somethingThatExistsOnlyThisCase)\r\n} else if(response.result === 'somethingElse') {\r\n // Do something else and typesafely access special fields\r\n console.log(response.somethingElseThatExistsOnlyThisCase)\r\n}\r\n```\r\n\r\n### Describe alternate solutions\r\n\r\nI can achieve the same thing if I use 200 for every request, but it's not the same.\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!\n\n\u003Csub>[TRP-37](https://linear.app/trpc/issue/TRP-37/feat-fetch-like-behaviour-for-non-200-error-codes)\u003C/sub>",[3080,3083],{"name":3081,"color":3082},"๐ก ideas","bfdadc",{"name":3084,"color":3085},"next-major/maybe","D4C5F9",3438,"feat: inferable errors from procedures","2025-03-20T15:41:30Z","https://github.com/trpc/trpc/issues/3438",0.8007711,{"description":3092,"labels":3093,"number":3096,"owner":3029,"repository":3029,"state":3097,"title":3098,"updated_at":3099,"url":3100,"score":3101},"### Provide environment information\n\nhttps://stackblitz.com/github/trpc/examples-next-minimal-starter\r\n\r\nChrome: 108.0.5359.124\r\nFirefox: 107.0.1\n\n### Describe the bug\n\nCurrently, the stackblitz project doesn't start due to some swc error\r\n\r\n\u003Cimg width=\"702\" alt=\"CleanShot 2022-12-20 at 09 55 21@2x\" src=\"https://user-images.githubusercontent.com/51714798/208625352-c316db4f-3776-4654-9de1-47087a8e10f5.png\">\r\n\n\n### Link to reproduction\n\nhttps://stackblitz.com/github/trpc/examples-next-minimal-starter\n\n### To reproduce\n\nGo to link, check console\n\n### Additional information\n\nSolutions:\r\n\r\n- Move to CodeSandbox? Slow\r\n\r\n- Look into error and figuring out what's causing it\n\n### ๐จโ๐งโ๐ฆ Contributing\n\n- [ ] ๐โโ๏ธ Yes, I'd be down to file a PR fixing this bug!",[3094,3095],{"name":3070,"color":3071},{"name":3039,"color":3040},3441,"closed","bug: codesandbox repro example not working","2023-02-09T18:10:38Z","https://github.com/trpc/trpc/issues/3441",0.75763357,{"description":3103,"labels":3104,"number":3105,"owner":3029,"repository":3029,"state":3097,"title":3106,"updated_at":3107,"url":3108,"score":3109},"### Provide environment information\r\n\r\n```\r\n System:\r\n OS: macOS 13.1\r\n CPU: (10) arm64 Apple M1 Max\r\n Memory: 867.38 MB / 32.00 GB\r\n Shell: 5.8.1 - /bin/zsh\r\n Binaries:\r\n Node: 16.14.2 - ~/Library/Caches/fnm_multishells/76195_1680926422917/bin/node\r\n Yarn: 1.22.19 - /opt/homebrew/bin/yarn\r\n npm: 8.5.0 - ~/Library/Caches/fnm_multishells/76195_1680926422917/bin/npm\r\n Browsers:\r\n Chrome: 111.0.5563.146\r\n Firefox: 111.0.1\r\n Safari: 16.2\r\n npmPackages:\r\n @tanstack/react-query: ^4.28.0 => 4.28.0 \r\n @trpc/client: ^10.19.1 => 10.19.1 \r\n @trpc/next: ^10.19.1 => 10.19.1 \r\n @trpc/react-query: ^10.19.1 => 10.19.1 \r\n @trpc/server: ^10.19.1 => 10.19.1 \r\n next: ^13.3.0 => 13.3.0 \r\n react: ^18.2.0 => 18.2.0 \r\n typescript: ^5.0.4 => 5.0.4 \r\n```\r\n\r\n### Describe the bug\r\n\r\nI'm encountering an infinite fetching/rendering loop under these circumstances: \r\n\r\n**Server Side**\r\nA query router that throws an error or TRPCError. For example:\r\n```typescript\r\n greeting: publicProcedure\r\n .input(z.object({ name: z.string() }))\r\n .query(({ input }) => {\r\n throw new Error(\"TEST ERR\");\r\n return {\r\n text: `hello ${input?.name ?? \"world\"}`,\r\n };\r\n }),\r\n```\r\n\r\n\r\n**Client Side**\r\nA `trpc.greeting.useQuery()` hook in a main react component\r\n```typescript\r\n// Greeting.tsx\r\n const greeting = trpc.greeting.useQuery(\r\n { name: \"tRPC user\" },\r\n { retry: false }\r\n );\r\n\r\n```\r\n An identical `trpc.greeting.useQuery()` hook (same query key) in a nested react component\r\n```typescript\r\n// /components/NestedComponent.tsx\r\n const greeting = trpc.greeting.useQuery(\r\n { name: \"tRPC user\" },\r\n { retry: false }\r\n );\r\n\r\n```\r\n\r\nAn imported NestedComponent in the main component but with an early return based off of greeting.isLoading:\r\n```typescript\r\n// Greeting.tsx\r\n\r\nimport { NestedComponent } from \"./components/NestedComponent\";\r\nimport { trpc } from \"./utils/trpc\";\r\n\r\nexport function Greeting() {\r\n const greeting = trpc.greeting.useQuery(\r\n { name: \"tRPC user\" },\r\n { retry: false }\r\n );\r\n\r\n if (greeting.isLoading) {\r\n return \u003C>Render Count... {renderCount}\u003C/>;\r\n }\r\n\r\n return (\r\n \u003Cdiv>\r\n \u003CNestedComponent />\r\n {greeting.data?.text}\r\n \u003C/div>\r\n );\r\n}\r\n```\r\n\r\nThese combinations of items will cause an infinite fetching/render loop for trpc.greeting.useQuery() even with retry set to false.\r\n\r\n**Expected behavior**\r\nI would expect that the early return boolean would flip eventually and would allow the main function to render properly after it tries one time to fetch the query (retry=false)\r\n\r\n\r\n\r\n\r\n### Link to reproduction\r\n\r\n\r\n[https://codesandbox.io/p/github/mcunningham/trpc-infinite-loop/main](https://codesandbox.io/p/github/mcunningham/trpc-infinite-loop/main?file=README.md&workspace=%257B%2522activeFilepath%2522%253A%2522README.md%2522%252C%2522openFiles%2522%253A%255B%2522README.md%2522%252C%2522%252Fclient%252Fsrc%252Fcomponents%252FNestedComponent.tsx%2522%252C%2522%252Fclient%252Fsrc%252FGreeting.tsx%2522%255D%252C%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522gitSidebarPanel%2522%253A%2522COMMIT%2522%252C%2522spaces%2522%253A%257B%2522clg7iqcux000x3b6k3wb2s46e%2522%253A%257B%2522key%2522%253A%2522clg7iqcux000x3b6k3wb2s46e%2522%252C%2522name%2522%253A%2522Default%2522%252C%2522devtools%2522%253A%255B%257B%2522key%2522%253A%2522clg7kvr2u00153b6kutbekix9%2522%252C%2522type%2522%253A%2522PROJECT_SETUP%2522%252C%2522isMinimized%2522%253Afalse%257D%252C%257B%2522type%2522%253A%2522PREVIEW%2522%252C%2522taskId%2522%253A%2522dev%2522%252C%2522port%2522%253A3000%252C%2522key%2522%253A%2522clg7iqr13009l3b6k1yn408rz%2522%252C%2522isMinimized%2522%253Afalse%257D%252C%257B%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522dev%2522%252C%2522key%2522%253A%2522clg7iqojr004f3b6kfjn95hky%2522%252C%2522isMinimized%2522%253Afalse%257D%255D%257D%257D%252C%2522currentSpace%2522%253A%2522clg7iqcux000x3b6k3wb2s46e%2522%252C%2522spacesOrder%2522%253A%255B%2522clg7iqcux000x3b6k3wb2s46e%2522%255D%252C%2522hideCodeEditor%2522%253Afalse%257D)\r\n\r\n### To reproduce\r\n\r\n\r\nThe reproduction [codesandbox link](https://codesandbox.io/p/github/mcunningham/trpc-infinite-loop/main?file=README.md&workspace=%257B%2522activeFilepath%2522%253A%2522README.md%2522%252C%2522openFiles%2522%253A%255B%2522README.md%2522%252C%2522%252Fclient%252Fsrc%252Fcomponents%252FNestedComponent.tsx%2522%252C%2522%252Fclient%252Fsrc%252FGreeting.tsx%2522%255D%252C%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522gitSidebarPanel%2522%253A%2522COMMIT%2522%252C%2522spaces%2522%253A%257B%2522clg7iqcux000x3b6k3wb2s46e%2522%253A%257B%2522key%2522%253A%2522clg7iqcux000x3b6k3wb2s46e%2522%252C%2522name%2522%253A%2522Default%2522%252C%2522devtools%2522%253A%255B%257B%2522key%2522%253A%2522clg7kvr2u00153b6kutbekix9%2522%252C%2522type%2522%253A%2522PROJECT_SETUP%2522%252C%2522isMinimized%2522%253Afalse%257D%252C%257B%2522type%2522%253A%2522PREVIEW%2522%252C%2522taskId%2522%253A%2522dev%2522%252C%2522port%2522%253A3000%252C%2522key%2522%253A%2522clg7iqr13009l3b6k1yn408rz%2522%252C%2522isMinimized%2522%253Afalse%257D%252C%257B%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522dev%2522%252C%2522key%2522%253A%2522clg7iqojr004f3b6kfjn95hky%2522%252C%2522isMinimized%2522%253Afalse%257D%255D%257D%257D%252C%2522currentSpace%2522%253A%2522clg7iqcux000x3b6k3wb2s46e%2522%252C%2522spacesOrder%2522%253A%255B%2522clg7iqcux000x3b6k3wb2s46e%2522%255D%252C%2522hideCodeEditor%2522%253Afalse%257D) shows an example using a slightly modified [minimal-react ](https://github.com/trpc/trpc/tree/main/examples/minimal-react) example. It shows an infinite loop state with a nested component imported into a main component returning early with the mock error being thrown immediately in the server side route. I have also been able to reproduce this in nextjs as well.\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- [ ] ๐โโ๏ธ Yes, I'd be down to file a PR fixing this bug!",[],4158,"bug: Infinite loop with main component + nested component calling identical .useQuery() hooks","2023-04-22T12:02:12Z","https://github.com/trpc/trpc/issues/4158",0.7765526,{"description":3111,"labels":3112,"number":3119,"owner":3029,"repository":3029,"state":3097,"title":3120,"updated_at":3121,"url":3122,"score":3123},"Maybe we should disable hover completely?\r\n\r\n---\r\n\r\ncc @KATT Generally this looks very cool and helpful, however, is there any configuration option for this? IMO kind of annoying that every single keyword exposes a \"big menu\". \r\n\r\n\r\nThese stuff seems kinda useless for our documentation\r\n\u003Cimg width=\"305\" alt=\"CleanShot 2022-08-18 at 21 25 36@2x\" src=\"https://user-images.githubusercontent.com/51714798/185477859-769360af-d65e-48cc-ba0d-17dde3a5f025.png\">\r\n\r\n\r\nWould prefer it only displaying types where we choose to display them, like \r\n\u003Cimg width=\"576\" alt=\"CleanShot 2022-08-18 at 21 24 28@2x\" src=\"https://user-images.githubusercontent.com/51714798/185477609-f2ca7161-0318-434d-abfe-18181d11dffd.png\">\r\n\r\nand the autocomplete highlighting also looks really good and showcases useful functionality.\r\n\u003Cimg width=\"403\" alt=\"CleanShot 2022-08-18 at 21 24 44@2x\" src=\"https://user-images.githubusercontent.com/51714798/185477651-fff2e751-d7bc-4f81-b5fb-9eadbd3c480f.png\">\r\n\r\n_Originally posted by @juliusmarminge in https://github.com/trpc/trpc/issues/2481#issuecomment-1219866316_",[3113,3116],{"name":3114,"color":3115},"๐ free for all","289B36",{"name":3117,"color":3118},"๐ธ www","666FF9",2499,"Less noisy shiki twoslash","2022-10-04T00:18:14Z","https://github.com/trpc/trpc/issues/2499",0.7773723,{"description":3125,"labels":3126,"number":3129,"owner":3029,"repository":3029,"state":3097,"title":3130,"updated_at":3131,"url":3132,"score":3133},"Can we leverage [Docusaurus versioning](https://docusaurus.io/docs/versioning) for V10?\r\n\r\nI **don't** want to do versioning for each minor/major, but it would be nice to have a `9.x` and `10.x` checked in.\r\n\r\nOtherwise, it's also perfectly fine if we have to independently deployed apps as well.\r\n\r\n",[3127,3128],{"name":3084,"color":3085},{"name":3117,"color":3118},2179,"Can we leverage Docusaurus versioning?","2022-10-04T06:09:04Z","https://github.com/trpc/trpc/issues/2179",0.78234994,["Reactive",3135],{},["Set"],["ShallowReactive",3138],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fA8DOIiHNTYgbbt8_B3QMVJv3uxy2BxW3FTHUqxzAces":-1},"/trpc/trpc-openapi/458"]