\n\n### Link to reproduction\n\nhttps://github.com/brandongit2/trpc-tanstack-router-bug-repro/blob/main/index.ts\n\n### To reproduce\n\n1. Clone the repro repo\n2. `pnpm install`\n3. Open `index.ts`\n4. Type error:\n ```ts\n Type 'QueryClient' is not assignable to type 'QueryClient | (() => QueryClient)'.\n Type 'import(\"/Users/brandontsang/projects/trpc-tanstack-router-bug-repro/node_modules/.pnpm/@tanstack+query-core@5.66.4/node_modules/@tanstack/query-core/build/modern/hydration-k2LfsAVL\", { with: { \"resolution-mode\": \"import\" } }).b' is not assignable to type 'import(\"/Users/brandontsang/projects/trpc-tanstack-router-bug-repro/node_modules/.pnpm/@tanstack+query-core@5.66.4/node_modules/@tanstack/query-core/build/modern/hydration-BHYO6Wdv\").b'.\n Property '#private' in type 'QueryClient' refers to a different member that cannot be accessed from within type 'QueryClient'.\n ```\n\n### Additional information\n\nThis comes from the fact that `@trpc/tanstack-react-query` doesn't have dedicated ESM type exports.\n\n- In my repro, I have:\n - `\"type\": \"module\"` in `package.json`\n - `\"moduleResolution\": \"nodenext\"` in my `tsconfig.json`\n- When I import from `@tanstack/react-query`, the `.d.ts` files are interpereted as ESM by TypeScript, since they have dedicated ESM type declarations:\n - \u003Cimg width=\"300\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/02697f38-cd10-45ba-b0e3-380b3a7cf568\" />\n- But when I import from `@trpc/tanstack-react-query`, the `.d.ts` files are interpereted as CJS by TypeScript, since the `package.json` doesn't specify `\"type\"`.\n- When `@trpc/tanstack-react-query`'s types import `@tanstack/react-query`, they come in as CJS types. `@tanstack/react-query`'s ESM and CJS types don't seem to be compatible with one another.\n\nIt could be argued that this is also a TanStack Query bug, since their ESM and CJS types ought to be compatible with one another anyway.\n\n---\n\n### Workarounds/fixes:\n\n1. Patch `@trpc/tanstack-react-query` to force ESM imports:\n - Find the `.d.ts` file that imports `@tanstack/react-query` (in this repro's case, it's `@trpc/tanstack-react-query/dist/internals/createOptionsProxy.d.ts`)\n - add an import attribute: `...from '@tanstack/react-query' with {'resolution-mode': 'import'}`\n - Type error gone!\n2. Or, in the user's project, import `@tanstack/react-query` as CJS and override the type:\n - \u003Cimg width=\"951\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/2bc65705-b4b9-45bd-bdf7-6213bebedee2\" />\n - Type error gone!\n\n### ๐จโ๐งโ๐ฆ Contributing\n\n- [ ] ๐โโ๏ธ Yes, I'd be down to file a PR fixing this bug!",[2865,2868],{"name":2866,"color":2867},"๐ bug","d73a4a",{"name":2869,"color":2870},"๐โโ๏ธ help wanted","008672",6554,"trpc","open","bug: Type incompatibility between `@trpc/tanstack-react-query` and `@tanstack/react-query`","2025-03-01T23:59:14Z","https://github.com/trpc/trpc/issues/6554",0.66876197,{"description":2879,"labels":2880,"number":2884,"owner":2872,"repository":2872,"state":2873,"title":2885,"updated_at":2886,"url":2887,"score":2888},"### Provide environment information\n\n```\r\n System:\r\n OS: macOS 14.4.1\r\n CPU: (8) arm64 Apple M1\r\n Memory: 62.41 MB / 16.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node\r\n npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm\r\n pnpm: 9.12.2 - ~/.nvm/versions/node/v20.10.0/bin/pnpm\r\n Browsers:\r\n Chrome: 130.0.6723.92\r\n Safari: 17.4.1\r\n npmPackages:\r\n @tanstack/react-query: ^5.59.19 => 5.59.19 \r\n @trpc/client: 11.0.0-rc.608 => 11.0.0-rc.608+f75de97b3 \r\n @trpc/react-query: 11.0.0-rc.608 => 11.0.0-rc.608+f75de97b3 \r\n react: ^18.3.1 => 18.3.1 \r\n typescript: ^5.6.3 => 5.6.3 \r\n```\n\n### Describe the bug\n\nI have a query which I just want to run in a certain condition (if another query had a non-empty result). I was trying to follow the docs (see https://trpc.io/docs/client/react/useQueries in conjunction with https://tanstack.com/query/v4/docs/framework/react/guides/dependent-queries#usequeries-dependent-query) but I could not get my code snippet to compile.\n\n### Link to reproduction\n\nhttps://stackblitz.com/edit/github-qa2kdy?file=src%2Fpages%2Findex.tsx\n\n### To reproduce\n\nChange the text in the variable `text` in line 10 of the `index.tsx`, and you'll see the error appear. To me the error only appeared after changing the text.\n\n### Additional information\n\nHere's the typescript error I get on the callback:\r\n\r\n```\r\nArgument of type '(t: UseQueriesProcedureRecord\u003C{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: false; }, { greeting: QueryProcedure\u003C{ input: { name?: string | null | undefined; }; output: { text: string; }; }>; }>) => [] | [...]' is not assignable to parameter of type '(t: UseQueriesProcedureRecord\u003C{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: false; }, { greeting: QueryProcedure\u003C{ input: { name?: string | null | undefined; }; output: { text: string; }; }>; }>) => readonly []'.\r\n Type '[] | [TrpcQueryOptionsForUseQueries\u003C{ text: string; }, { text: string; }, TRPCClientError\u003C{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: false; }>>]' is not assignable to type 'readonly []'.\r\n Type '[TrpcQueryOptionsForUseQueries\u003C{ text: string; }, { text: string; }, TRPCClientError\u003C{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: false; }>>]' is not assignable to type 'readonly []'.\r\n Source has 1 element(s) but target allows only 0.(2345)\r\n```\n\n### ๐จโ๐งโ๐ฆ Contributing\n\n- [ ] ๐โโ๏ธ Yes, I'd be down to file a PR fixing this bug!",[2881],{"name":2882,"color":2883},"๐ bug: unconfirmed","e99695",6188,"bug: React: Types for callback of `trpc.useQueries` doesn't allow returning an empty array","2025-03-20T15:42:41Z","https://github.com/trpc/trpc/issues/6188",0.6709997,{"description":2890,"labels":2891,"number":2893,"owner":2872,"repository":2872,"state":2873,"title":2894,"updated_at":2895,"url":2896,"score":2897},"### Provide environment information\n\n``` \nSystem:\n OS: macOS 14.5\n CPU: (12) arm64 Apple M2 Max\n Memory: 73.41 MB / 32.00 GB\n Shell: 5.9 - /bin/zsh\n Binaries:\n Node: 20.18.0 - ~/.nvm/versions/node/v20.18.0/bin/node\n Yarn: 1.22.22 - ~/Library/pnpm/yarn\n npm: 10.8.2 - ~/.nvm/versions/node/v20.18.0/bin/npm\n Browsers:\n Chrome: 135.0.7049.117\n Edge: 134.0.3124.62\n Safari: 17.5\n npmPackages:\n @trpc/server: ^11.1.2 => 11.1.2 \n typescript: ^5.8.3 => 5.8.3 \n```\n\n### Describe the bug\n\nWhen using the documented pattern for defining a router (verbatim from https://trpc.io/docs/server/routers), TypeScript emits declaration files that include imports from `@trpc/server/dist/unstable-core-do-not-import`, which is not exposed via the packageโs exports field.\n\nThis makes the generated `.d.ts` files invalid for consumers that rely on strict ESM resolution, including build tools and downstream libraries.\n\n### Link to reproduction\n\nhttps://github.com/extradosages/trpc-type-leak-demo\n\n### To reproduce\n\nUse the following `trpc.ts` and `router.ts` files (copied verbatim from the docs):\n\n`trcp.ts`\n```ts\nimport { initTRPC } from '@trpc/server';\nconst t = initTRPC.create();\nexport const router = t.router;\nexport const publicProcedure = t.procedure;\n```\n\n`router.ts`\n```ts\nimport { publicProcedure, router } from './trpc';\nconst appRouter = router({\n greeting: publicProcedure.query(() => 'hello tRPC v10!'),\n});\nexport type AppRouter = typeof appRouter;\n```\n\nRun:\n```bash\ntsc --emitDeclarationOnly\n```\n\nObserve that `router.d.ts` includes:\n```ts\ndeclare const appRouter: import(\"@trpc/server/dist/unstable-core-do-not-import\").BuiltRouter\u003C...>;\n```\n\nCompare to the `package.json` `exports` field:\n```json\n\"exports\": {\n \".\": {\n \"import\": \"./dist/index.mjs\",\n ...\n },\n ...\n \"./unstable-core-do-not-import\": {\n \"import\": \"./dist/unstable-core-do-not-import.mjs\",\n ...\n }\n}\n```\n\n### Additional information\n\nMight be solved by https://github.com/trpc/trpc/issues/5004.\n\nCurrently running a workaround in production with the following patch:\n```diff\ndiff --git a/package.json b/package.json\nindex 1f03d01bd1148bffc1434ac66f9feb52ba654bc3..f73cdbd446c2421a377af8ce0459288e1ee1162b 100644\n--- a/package.json\n+++ b/package.json\n@@ -73,6 +73,11 @@\n \"require\": \"./dist/adapters/ws.js\",\n \"default\": \"./dist/adapters/ws.js\"\n },\n+ \"./dist/*\": {\n+ \"import\": \"./dist/*\",\n+ \"require\": \"./dist/*\",\n+ \"default\": \"./dist/*\"\n+ },\n \"./http\": {\n \"import\": \"./dist/http.mjs\",\n \"require\": \"./dist/http.js\",\n```\n\n### ๐จโ๐งโ๐ฆ Contributing\n\n- [ ] ๐โโ๏ธ Yes, I'd be down to file a PR fixing this bug!",[2892],{"name":2882,"color":2883},6753,"bug: generated `.d.ts` files leaking un-exported types","2025-05-07T23:42:57Z","https://github.com/trpc/trpc/issues/6753",0.6718748,{"description":2899,"labels":2900,"number":2902,"owner":2872,"repository":2872,"state":2873,"title":2903,"updated_at":2904,"url":2905,"score":2906},"### Provide environment information\n\n```\nSystem:\n OS: macOS 15.3.2\n CPU: (10) arm64 Apple M1 Max\n Memory: 14.50 GB / 64.00 GB\n Shell: 5.9 - /bin/zsh\nBinaries:\n Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node\n npm: 11.2.0 - ~/.nvm/versions/node/v22.14.0/bin/npm\n pnpm: 10.8.0 - ~/.nvm/versions/node/v22.14.0/bin/pnpm\nBrowsers:\n Chrome: 135.0.7049.85\n Safari: 18.3.1\nnpmPackages:\n @tanstack/react-query: 5.72.2 => 5.72.2 \n @trpc/client: 11.1.0 => 11.1.0 \n @trpc/server: 11.1.0 => 11.1.0 \n react: 19.1.0 => 19.1.0 \n typescript: 5.8.3 => 5.8.3\n```\n\n### Describe the bug\n\nWhen using `useSuspenseInfiniteQueries` with `.infiniteQueryOptions`, a type error is reported but functionally works. `Type 'typeof skipToken' is not assignable to type 'QueryFunction...`\n\n### Link to reproduction\n\nhttps://codesandbox.io/p/devbox/snowy-river-psjh7x\n\n### To reproduce\n\n`src/routes/index.tsx`. Line ~20 is the type error with the `skipToken`.\n\nIgnore all the other errors in that page about posts, thats from the default tanstack router example.\n\n### Additional information\n\nIt's just a type error, it functionally works, just annoying having to throw an `ts-expect-error` because it might swallow input errors as well.\n\n### ๐จโ๐งโ๐ฆ Contributing\n\n- [ ] ๐โโ๏ธ Yes, I'd be down to file a PR fixing this bug!",[2901],{"name":2882,"color":2883},6701,"bug: `useSuspenseInfiniteQueries` `typeof skipToken is not assignable to type 'QueryFunction...` Type Error","2025-05-10T23:50:55Z","https://github.com/trpc/trpc/issues/6701",0.673081,{"description":2908,"labels":2909,"number":2910,"owner":2872,"repository":2872,"state":2911,"title":2912,"updated_at":2913,"url":2914,"score":2915},"### Provide environment information\n\nSystem:\r\n OS: macOS 12.5\r\n CPU: (10) arm64 Apple M1 Pro\r\n Memory: 75.72 MB / 32.00 GB\r\n Shell: 5.8.1 - /bin/zsh\r\n Binaries:\r\n Node: 18.10.0 - ~/.nvm/versions/node/v18.10.0/bin/node\r\n Yarn: 1.22.19 - ~/.nvm/versions/node/v18.10.0/bin/yarn\r\n npm: 8.19.2 - ~/.nvm/versions/node/v18.10.0/bin/npm\r\n Browsers:\r\n Chrome: 106.0.5249.119\r\n Firefox: 106.0.1\r\n Safari: 15.6\r\n npmPackages:\r\n typescript: ^4.8.4 => 4.8.4 \n\n### Describe the bug\n\n```\r\n[{\r\n\t\"resource\": \"/Users/zeno/Work/cryptopus/client/src/query/trpc.ts\",\r\n\t\"owner\": \"typescript\",\r\n\t\"code\": \"2344\",\r\n\t\"severity\": 8,\r\n\t\"message\": \"Type 'Router\u003C{ _config: RootConfig\u003C{ ctx: {}; meta: {}; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>; router: true; ... 5 more ...; isDev: boolean; }> & { ...; } & { ...; }' does not satisfy the constraint 'Router\u003CAnyRouterDef\u003CAnyRootConfig, any>>'.\\n The types returned by 'createCaller(...)' are incompatible between these types.\\n Type '{ query: inferHandlerFn\u003C{}>; mutation: inferHandlerFn\u003C{}>; subscription: inferHandlerFn\u003C{}>; } & DecoratedProcedureRecord\u003C{ getPairs: BuildProcedure\u003C\\\"query\\\", { _config: RootConfig\u003C...>; ... 5 more ...; _output_out: unique symbol; }, (\\\"BTCUSDT\\\" | ... 15 more ... | \\\"KDAUSDT\\\")[]>; getKlines: BuildProcedure\u003C...>; } & { ...' is not assignable to type '{ query: inferHandlerFn\u003Cany>; mutation: inferHandlerFn\u003Cany>; subscription: inferHandlerFn\u003Cany>; } & DecoratedProcedureRecord\u003Cany>'.\\n Type '{ query: inferHandlerFn\u003C{}>; mutation: inferHandlerFn\u003C{}>; subscription: inferHandlerFn\u003C{}>; } & DecoratedProcedureRecord\u003C{ getPairs: BuildProcedure\u003C\\\"query\\\", { _config: RootConfig\u003C...>; ... 5 more ...; _output_out: unique symbol; }, (\\\"BTCUSDT\\\" | ... 15 more ... | \\\"KDAUSDT\\\")[]>; getKlines: BuildProcedure\u003C...>; } & { ...' is not assignable to type '{ query: inferHandlerFn\u003Cany>; mutation: inferHandlerFn\u003Cany>; subscription: inferHandlerFn\u003Cany>; }'.\\n Types of property 'query' are incompatible.\\n Type 'inferHandlerFn\u003C{}>' is not assignable to type 'inferHandlerFn\u003Cany>'.\\n Types of parameters 'path' and 'path' are incompatible.\\n Type 'TPath' is not assignable to type 'never'.\\n Type 'string' is not assignable to type 'never'.\",\r\n\t\"source\": \"ts\",\r\n\t\"startLineNumber\": 6,\r\n\t\"startColumn\": 37,\r\n\t\"endLineNumber\": 6,\r\n\t\"endColumn\": 46\r\n}]\r\n```\r\n\u003Cimg width=\"538\" alt=\"image\" src=\"https://user-images.githubusercontent.com/112834462/198575775-cc733604-cf06-48d6-a459-a5f9af04b5eb.png\">\r\n\r\nclient trpc\r\n```\r\nimport type { AppRouter } from '@server/trpc';\r\nimport { createTRPCReact } from '@trpc/react-query';\r\nimport { Context } from '@server/context';\r\n\r\nexport const trpc = createTRPCReact\u003CAppRouter>({\r\n \r\n});\r\n```\r\n\r\n\r\n\r\nserver trpc:\r\n\r\n```\r\nimport { initTRPC } from '@trpc/server';\r\nimport { indicatorRouter } from './routers/indicator.router';\r\nimport { klineRouter } from './routers/kline.router';\r\n\r\n//const t = initTRPC.create();\r\n//export const t = initTRPC.context\u003CContext>().create();\r\nexport const t = initTRPC.create();\r\n\r\n\r\nexport const middleware = t.middleware;\r\nexport const router = t.router;\r\nexport const publicProcedure = t.procedure;\r\n\r\n\r\nexport const appRouter = t.mergeRouters(klineRouter, indicatorRouter)\r\n// only export *type signature* of router!\r\n// to avoid accidentally importing your API\r\n// into client-side code\r\nexport type AppRouter = typeof appRouter;\r\n\r\n```\r\n\r\nversions:\r\n\r\n \"@trpc/client\": \"10.0.0-proxy-beta.26\",\r\n \"@trpc/react-query\": \"10.0.0-proxy-beta.26\",\r\n \"@trpc/server\": \"10.0.0-proxy-beta.26\",\r\n \r\nnode: 18.10.0\r\ntypescript: 4.8.4\r\n\r\n\n\n### Link to reproduction\n\ndont have one\n\n### To reproduce\n\nabove\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!",[],3089,"closed","bug: cant use with react ","2022-11-16T06:02:00Z","https://github.com/trpc/trpc/issues/3089",0.553843,{"description":2917,"labels":2918,"number":2919,"owner":2872,"repository":2872,"state":2911,"title":2920,"updated_at":2921,"url":2922,"score":2923},"### Provide environment information\n\nOS: macOS 13.0\r\nCPU: (8) x64 Apple M1\r\nMemory: 16.57 MB / 16.00 GB\r\nShell: 5.5.1 - /usr/local/bin/zsh\r\nBinaries:\r\nNode: 14.18.3 - ~/.nvm/versions/node/v14.18.3/bin/node\r\nYarn: 1.22.19 - ~/.nvm/versions/node/v14.18.3/bin/yarn\r\nnpm: 8.13.1 - ~/.nvm/versions/node/v14.18.3/bin/npm\r\nBrowsers:\r\nBrave Browser: 87.1.18.75\r\nChrome: 107.0.5304.110\r\nFirefox: 105.0.3\r\nFirefox Developer Edition: 76.0\r\nSafari Technology Preview: 16.4\r\n\n\n### Describe the bug\n\nI don't really know how this type checking really works but if somehow the client repo has different trpc version than the server ones, if I start the client side (e.g. nuxt) it will throw an error.\r\n\r\nError stacktrace\r\n```\r\nERROR 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\nThe types returned by 'createCaller(...)' are incompatible between these types.\r\nType '{ query: inferHandlerFn\u003C{}>; mutation: inferHandlerFn\u003C{}>; subscription: inferHandlerFn\u003C{}>; } & DecoratedProcedureRecord\u003C{ exportReport: BuildProcedure\u003C\"query\", { ...; }, { ...; }>; }>' is not assignable to type '{ query: inferHandlerFn; mutation: inferHandlerFn; subscription: inferHandlerFn; } & DecoratedProcedureRecord'.\r\nType '{ query: inferHandlerFn\u003C{}>; mutation: inferHandlerFn\u003C{}>; subscription: inferHandlerFn\u003C{}>; } & DecoratedProcedureRecord\u003C{ exportReport: BuildProcedure\u003C\"query\", { ...; }, { ...; }>; }>' is not assignable to type '{ query: inferHandlerFn; mutation: inferHandlerFn; subscription: inferHandlerFn; }'.\r\nTypes of property 'query' are incompatible.\r\nType 'inferHandlerFn\u003C{}>' is not assignable to type 'inferHandlerFn'.\r\nTypes of parameters 'path' and 'path' are incompatible.\r\nType 'TPath' is not assignable to type 'never'.\r\nType 'string' is not assignable to type 'never'.\r\n```\r\n\r\nIf I understand it correctly, type checking in this case is probably inferred from the compilation time, how is the version of another repo that host the server app router code has to do with this and invalidate the inference? I'm really confused.\n\n### Link to reproduction\n\n123\n\n### To reproduce\n\nI have two repos, frontend-code and backend-code\r\n\r\nfrontend-code has yarn.lock `trpc/client 10.0.0-rc.8`, `trpc/client 10.0.0-rc.8`\r\nbackend-code has yarn.lock `trpc/client 10.0.0-rc.7`\r\n\r\nThe code that throw an error from (this runs in a nuxt project as a plugin)\r\n```\r\nimport Vue from 'vue'\r\nimport { createTRPCProxyClient, httpBatchLink } from '@trpc/client';\r\nimport type { AppRouter } from '../../../backend-code/server/_app';\r\n\r\nexport const client = createTRPCProxyClient\u003CAppRouter>({\r\n links: [\r\n httpBatchLink({\r\n url: process.env.TRPC_URL || '',\r\n fetch(url, options) {\r\n return fetch(url, {\r\n ...options,\r\n credentials: 'omit', // cors\r\n });\r\n },\r\n }),\r\n ],\r\n});\r\n```\r\n\r\nCode in ../../../backend-code/server/_app\r\n```\r\nimport { mergeRouters } from './trpc';\r\nimport { exportRouter } from './routers/report' // (a typical trpc router)\r\nย \r\nexport const appRouter = exportRouter;\r\nย \r\n// Export **type** of a router\r\nexport type AppRouter = typeof appRouter;\r\n```\r\n\r\n\r\nError stacktrace\r\n```\r\nERROR 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\nThe types returned by 'createCaller(...)' are incompatible between these types.\r\nType '{ query: inferHandlerFn\u003C{}>; mutation: inferHandlerFn\u003C{}>; subscription: inferHandlerFn\u003C{}>; } & DecoratedProcedureRecord\u003C{ exportReport: BuildProcedure\u003C\"query\", { ...; }, { ...; }>; }>' is not assignable to type '{ query: inferHandlerFn; mutation: inferHandlerFn; subscription: inferHandlerFn; } & DecoratedProcedureRecord'.\r\nType '{ query: inferHandlerFn\u003C{}>; mutation: inferHandlerFn\u003C{}>; subscription: inferHandlerFn\u003C{}>; } & DecoratedProcedureRecord\u003C{ exportReport: BuildProcedure\u003C\"query\", { ...; }, { ...; }>; }>' is not assignable to type '{ query: inferHandlerFn; mutation: inferHandlerFn; subscription: inferHandlerFn; }'.\r\nTypes of property 'query' are incompatible.\r\nType 'inferHandlerFn\u003C{}>' is not assignable to type 'inferHandlerFn'.\r\nTypes of parameters 'path' and 'path' are incompatible.\r\nType 'TPath' is not assignable to type 'never'.\r\nType 'string' is not assignable to type 'never'.\r\n```\r\n\r\nIf I understand it correctly, type checking in this case is probably inferred from the compilation time, how is the version of another repo that host the server app router code has to do with this and invalidate the inference? I'm really confused.\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!",[],3206,"bug: if trpc package version is different between server and client code it will throw an error","2022-11-20T14:06:29Z","https://github.com/trpc/trpc/issues/3206",0.57909214,{"description":2925,"labels":2926,"number":2930,"owner":2872,"repository":2872,"state":2911,"title":2931,"updated_at":2932,"url":2933,"score":2934},"### Provide environment information\n\nmacos\r\nvscode\r\nelectron-vite\r\nreact\r\n\r\nmonorepo with yarn workspaces\r\nclient electron app and server app in different packages\n\n### Describe the bug\n\nTrying to instantiate the trpc client, I get a type mismatch error.\r\n\r\nHere is the file. My editor shows red squiggle/type error on the `\u003CAppRouter>`\r\n\r\n```\r\nimport { createTRPCProxyClient, httpLink } from '@trpc/client'\r\nimport type { AppRouter } from '@flowy/server/src/router'\r\nimport CONFIG from '../config/config'\r\n\r\nconst trpc = createTRPCProxyClient\u003CAppRouter>({\r\n links: [\r\n httpLink({\r\n url: `${CONFIG.API_URL}/trpc`,\r\n headers: () => {\r\n return {\r\n authorization: ''\r\n }\r\n }\r\n })\r\n ]\r\n})\r\n\r\nexport default trpc\r\n```\r\n\r\nThe error is as follows: \r\n```\r\nType 'CreateRouterInner\u003CRootConfig\u003C{ ctx: Context; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { ...; }>' 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{ hello: BuildProcedure\u003C\"query\", { _config: RootConfig\u003C...>; ... 5 more ...; _output_out: unique symbol; }, string>; ... 12 more ...; s3: CreateRouterInner\u003C...>; }>' 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{ hello: BuildProcedure\u003C\"query\", { _config: RootConfig\u003C...>; ... 5 more ...; _output_out: unique symbol; }, string>; ... 12 more ...; s3: CreateRouterInner\u003C...>; }>' 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'.ts(2344)\r\n```\r\n\r\nThe instantiation works with a solidjs client app, but not in this one.\r\n\n\n### Link to reproduction\n\nhttps://trpc.io/docs/quickstart#using-your-new-backend-on-the-client\n\n### To reproduce\n\nFollowing the quickstart docs in trpc, specifically the client side:\r\nhttps://trpc.io/docs/quickstart#using-your-new-backend-on-the-client\n\n### Additional information\n\nI am able to ts-ignore it and use it fine, but I am surprised that the quickstart doesn't work for me and that no one else is having this problem. \n\n### ๐จโ๐งโ๐ฆ Contributing\n\n- [ ] ๐โโ๏ธ Yes, I'd be down to file a PR fixing this bug!",[2927],{"name":2928,"color":2929},"๐ป invalid","e4e669",3658,"bug: Quickstart trpc Client Type Error","2023-02-19T18:01:46Z","https://github.com/trpc/trpc/issues/3658",0.61969435,{"description":2936,"labels":2937,"number":2942,"owner":2872,"repository":2872,"state":2911,"title":2943,"updated_at":2944,"url":2945,"score":2946},"### Provide environment information\r\n\r\n```\r\n System:\r\n OS: macOS 12.6\r\n CPU: (8) arm64 Apple M1 Pro\r\n Memory: 102.69 MB / 16.00 GB\r\n Shell: 5.8.1 - /bin/zsh\r\n Binaries:\r\n Node: 18.12.1 - ~/Library/Caches/fnm_multishells/33773_1664501269786/bin/node\r\n Yarn: 1.22.18 - ~/.nvm/versions/node/v16.13.0/bin/yarn\r\n npm: 8.19.2 - ~/Library/Caches/fnm_multishells/33773_1664501269786/bin/npm\r\n Browsers:\r\n Brave Browser: 107.1.45.133\r\n Chrome: 108.0.5359.124\r\n Firefox: 108.0.1\r\n Safari: 16.0\r\n npmPackages:\r\n @tanstack/react-query: ^4.20.4 => 4.20.4\r\n @trpc/client: ^10.7.0 => 10.7.0\r\n @trpc/next: ^10.7.0 => 10.7.0\r\n @trpc/react-query: ^10.7.0 => 10.7.0\r\n @trpc/server: ^10.7.0 => 10.7.0\r\n next: ^12.2.5 => 12.3.4\r\n react: ^17.0.2 => 17.0.2\r\n typescript: ^4.7.4 => 4.9.4\r\n ```\r\n\r\n### Describe the bug\r\n\r\nI have monorepo setup with Lambda backend and Next frontend.\r\n\r\nAdding `createTRPCNext` with the backend router throws the type error:\r\n\r\n> Types of property '_def' are incompatible.\r\n\r\nFull error:\r\n```\r\nType 'CreateRouterInner\u003CRootConfig\u003C{ ctx: { event: APIGatewayProxyEventV2; }; meta: object; errorShape: never; transformer: DataTransformerOptions; }>, { ...; }>' does not satisfy the constraint 'Router\u003CAnyRouterDef\u003CAnyRootConfig, any>>'. ย ย Types of property '_def' are incompatible. ย ย ย ย Type 'RouterDef\u003CRootConfig\u003C{ ctx: { event: APIGatewayProxyEventV2; }; meta: object; errorShape: never; transformer: DataTransformerOptions; }>, { ...; }, { ...; }>' is not assignable to type 'AnyRouterDef\u003CAnyRootConfig, any>'.\r\n```\r\n\r\nLooks like adapters are incompatible.\r\n\r\n```\r\n// backend/.../router\r\n\r\nimport { AppContext } from './server'\r\n\r\nexport const t = initTRPC.context\u003CAppContext>().create()\r\n\r\nexport const router = t.router({\r\n greeting: t.procedure.query(\r\n () => 'Hello'\r\n ),\r\n})\r\n\r\nexport type ApiRouter = typeof router\r\n```\r\n```\r\n// backend/.../server.ts\r\nexport const appContext = ({\r\n event,\r\n}: CreateAWSLambdaContextOptions\u003CAPIGatewayProxyEventV2>) => event\r\n\r\nexport const handler = awsLambdaRequestHandler({\r\n router,\r\n createContext: appContext,\r\n})\r\n\r\n```\r\n\r\n```\r\n// frontend/util/trpc.ts\r\nimport type { ApiRouter } from '../../backend/src/app/api/trpc/router'\r\n\r\nexport const trpc = createTRPCNext\u003CApiRouter>...\r\n```\r\n\r\n\r\n### Link to reproduction\r\n\r\nhttps://www.example.com\r\n\r\n### To reproduce\r\n\r\nSorry, difficult to provide easily create reproductive repo due to the monorepo setup.\r\nI can try to do add something if its really needed.\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!",[2938,2939],{"name":2928,"color":2929},{"name":2940,"color":2941},"โฎ needs reproduction","000055",3484,"bug: TRPCNext adapter is incompatible with Lambda Adapter","2023-01-11T00:43:15Z","https://github.com/trpc/trpc/issues/3484",0.6498171,{"description":2948,"labels":2949,"number":2952,"owner":2872,"repository":2872,"state":2911,"title":2953,"updated_at":2954,"url":2955,"score":2956},"### Provide environment information\n\n System:\r\n OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)\r\n CPU: (6) x64 Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz\r\n Memory: 11.11 GB / 15.59 GB\r\n Container: Yes\r\n Shell: 5.1.16 - /bin/bash\r\n\r\n Binaries:\r\n Node: 19.0.1 - /usr/bin/node\r\n npm: 8.19.2 - /usr/bin/npm\r\n\r\n npmPackages:\r\n @trpc/server: 10.0.0-rc.7 => 10.0.0-rc.7 \r\n typescript: 4.8.4 => 4.8.4 \n\n### Describe the bug\n\nI'm getting this error when using the client:\r\n\r\n\r\n\r\n```\r\nType 'RootConfig\u003C{ ctx: Context; meta: { auth: \"none\" | \"admin\" | \"user\"; }; errorShape: never; transformer: CombinedDataTransformer; }>' is not assignable to type 'AnyRootConfig'.\r\n Type 'any' is not assignable to type 'never'.ts(2344)\r\n```\r\n\r\nI think it's caused by the `errorShape` being `never`. Not sure why it's doing that, as in the \"minimal reproduction template\" the `errorShape` is by default `DefaultErrorShape`.\r\n\r\nServer initialisation:\r\n\r\n\r\n\n\n### Link to reproduction\n\nN/A\n\n### To reproduce\n\nI'm just using the default `initTRPC` function. Nothing else is affecting that function. If I do a simple\r\n\r\n```\r\nconst t = initTRPC.create();\r\n```\r\n\r\nI still get `errorShape: never`\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!",[2950,2951],{"name":2928,"color":2929},{"name":2940,"color":2941},3151,"bug: `AppRouter` type has `errorShape: never`","2022-11-25T12:02:18Z","https://github.com/trpc/trpc/issues/3151",0.6549574,{"description":2958,"labels":2959,"number":2960,"owner":2872,"repository":2872,"state":2911,"title":2961,"updated_at":2962,"url":2963,"score":2964},"### 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,"bug: `TRPCClient` from `createTRPCReact\u003CRouterType>().createClient` is incorrectly typed","2022-10-05T23:29:07Z","https://github.com/trpc/trpc/issues/2922",0.6550141,["Reactive",2966],{},["Set"],["ShallowReactive",2969],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fdjQ-WUE523KPaS6ZD43L1gEYGgPQJWzr7_VFi1m1-84":-1},"/trpc/trpc/3202"]