\r\n \u003CStack.Screen name=\"Results\" component={ResultsComponent}/>\r\n \u003C/Stack.Navigator>\r\n \u003C/NavigationContainer>\r\n \u003C/ThemeProvider>\r\n \u003C/TRPCProvider>\r\n \u003C/AuthenticationProvider>\r\n );\r\n}\r\n```\r\nmy component\r\n\r\n```\r\nimport { trpc } from \"../../utils/trpc-client\";\r\n\r\nexport function ResultsComponent({navigation, route}) {\r\n\r\n const {data} = trpc.moviesRecommendation.useQuery(\r\n {\r\n runtimeMinsMin: 100\r\n }\r\n )\r\n```\r\ntrpc-client.ts\r\n\r\n```\r\nimport { AppRouter } from \"../server/trpc\";\r\nimport { createTRPCReact, httpLink } from \"@trpc/react-query\";\r\n\r\nexport const trpc = createTRPCReact\u003CAppRouter>()\r\n\r\nexport const trpcClient = trpc.createClient({\r\n links: [httpLink({url: 'http://localhost:3000/api/trpc'})],\r\n})\r\n```\r\nand trpc-provider.ts\r\n\r\n```\r\nexport function TRPCProvider({children}: PropsWithChildren) {\r\n const [queryClient] = useState(() => new QueryClient())\r\n\r\n return (\r\n \u003Ctrpc.Provider client={trpcClient} queryClient={queryClient}>\r\n \u003CQueryClientProvider client={queryClient} contextSharing={true}>\r\n {children}\r\n \u003C/QueryClientProvider>\r\n \u003C/trpc.Provider>\r\n )\r\n}\r\n```\r\nSo is the web error while using useQuery:\r\n```\r\n\r\nUncaught Error: No QueryClient set, use QueryClientProvider to set one\r\n at Object.useQueryClient (QueryClientProvider.tsx:48:1)\r\n at Object.useBaseQuery (useBaseQuery.ts:33:1)\r\n at useQuery (useQuery.ts:139:1)\r\n at Object.useQuery$1 [as useQuery] (createHooksInternal-808efaa7.mjs:277:1)\r\n at createHooksInternal-808efaa7.mjs:52:1\r\n at Object.apply (index-972002da.mjs:18:1)\r\n at ResultsComponent (results-component.tsx:11:1)\r\n at renderWithHooks (react-dom.development.js:16175:1)\r\n at mountIndeterminateComponent (react-dom.development.js:20913:1)\r\n at beginWork (react-dom.development.js:22416:1)\r\n```\r\n\r\n\r\n\r\n",[3066],{"name":3067,"color":3068},"👻 invalid","e4e669",3316,"bug: Expo + trpc: Uncaught Error: No QueryClient set, use QueryClientProvider to set one","2022-12-20T12:02:19Z","https://github.com/trpc/trpc/issues/3316",0.6558566,{"description":3075,"labels":3076,"number":3077,"owner":3023,"repository":3023,"state":3042,"title":3078,"updated_at":3079,"url":3080,"score":3081},"### 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.656368,{"description":3083,"labels":3084,"number":3087,"owner":3023,"repository":3023,"state":3042,"title":3088,"updated_at":3089,"url":3090,"score":3091},"### Provide environment information\n\n```\nSystem:\n OS: macOS 15.3\n CPU: (8) arm64 Apple M2\n Memory: 2.18 GB / 24.00 GB\n Shell: 3.2.57 - /bin/sh\n Binaries:\n Node: 22.12.0 - /usr/local/bin/node\n npm: 11.0.0 - /usr/local/bin/npm\n pnpm: 9.15.4 - /usr/local/bin/pnpm\n Browsers:\n Brave Browser: 132.1.74.48\n Safari: 18.3\n npmPackages:\n @tanstack/react-query: ^5.65.1 => 5.65.1 \n @trpc/client: 11.0.0-rc.730 => 11.0.0-rc.730+776d07336 \n @trpc/react-query: 11.0.0-rc.730 => 11.0.0-rc.730+776d07336 \n @trpc/server: 11.0.0-rc.730 => 11.0.0-rc.730+776d07336 \n next: 15.1.6 => 15.1.6 \n react: ^19.0.0 => 19.0.0 \n typescript: ^5 => 5.7.3 \n```\n\n### Describe the bug\n\nI write protected `procedures` and throwing error from middleware-\n\n```\nimport { initTRPC, TRPCError } from \"@trpc/server\";\n\n//Context\nimport { Context } from \"./context\";\n\n\nconst t = initTRPC.context\u003CContext>().create();\n\nexport const router = t.router;\nexport const procedure = t.procedure.use(\n async function isAuthed(opts) {\n const { ctx } = opts;\n if (!ctx.user) {\n throw new TRPCError({ code: \"UNAUTHORIZED\", message: \"Unauthorized request. Please login\" })\n }\n return opts.next({\n ctx: {\n user: ctx.user\n }\n })\n }\n);\nexport const publicProcedure = t.procedure;\nexport const createCallerFactory = t.createCallerFactory;\n```\n\nHere I throw error for unauthorized request. There this is createContext-\n\nimport { getSession } from \"../auth/next-auth\";\n\nexport const createContext = async () => {\n const user = await getSession();\n return user;\n}\n\nexport type Context = Awaited\u003CReturnType\u003Ctypeof createContext>>;\n\nAnd on a now server page component-\nI just prefetch one request-\n\n```\n//TRPC\nimport { trpc, HydrateClient } from \"@/trpc/server\";\n\nconst Page = async () => {\n //TRPC\n await trpc.unavailability.list.prefetch();\n\n return (\n \u003CHydrateClient>\n \u003CList />\n \u003C/HydrateClient>\n );\n};\n\nexport default Page;\n```\nAll is working on local development is perfect. But when I try to build it-\n\n```\nError occurred prerendering page \"/unavailability\". Read more: https://nextjs.org/docs/messages/prerender-error\nTRPCClientError: Unauthorized request. Please login\n at s.from (/vercel/path0/.next/server/chunks/949.js:3:83107)\n at /vercel/path0/.next/server/chunks/949.js:3:89907\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\nExport encountered an error on /(dashboard)/unavailability/page: /unavailability, exiting the build.\n ⨯ Static worker exited with code: 1 and signal: null\n ELIFECYCLE Command failed with exit code 1.\nError: Command \"pnpm run build\" exited with 1\n\n```\n\n\nSo, it is natural that on build time, there is no authentications. But it stopping to build it-\n\n\n\n\n### Link to reproduction\n\nhttps://github.com/wegreet/dashboard-new-design\n\n### To reproduce\n\nJust build it with vercel\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!",[3085,3086],{"name":3067,"color":3068},{"name":3020,"color":3021},6441,"bug: TRPC with nextjs 15(App Router) production build failed!","2025-02-05T17:24:47Z","https://github.com/trpc/trpc/issues/6441",0.6595295,{"description":3093,"labels":3094,"number":3096,"owner":3023,"repository":3023,"state":3042,"title":3097,"updated_at":3098,"url":3099,"score":3100},"### Provide environment information\r\n\r\n```shell\r\nSystem:\r\n OS: Windows 10 10.0.22621\r\n CPU: (16) x64 AMD Ryzen 7 5800X 8-Core Processor\r\n Memory: 18.04 GB / 31.93 GB\r\n Binaries:\r\n Node: 18.15.0 - C:\\Program Files\\nodejs\\node.EXE\r\n Yarn: 1.22.19 - C:\\Program Files\\nodejs\\yarn.CMD\r\n npm: 9.6.7 - C:\\Program Files\\nodejs\\npm.CMD\r\n pnpm: 8.6.5 - C:\\Program Files\\nodejs\\pnpm.CMD\r\n Browsers:\r\n Edge: Spartan (44.22621.1848.0), Chromium (114.0.1823.67)\r\n Internet Explorer: 11.0.22621.1\r\n npmPackages:\r\n @tanstack/react-query: ^4.18.0 => 4.18.0 \r\n @trpc/client: ^10.33.0 => 10.33.0 \r\n @trpc/next: ^10.33.0 => 10.33.0 \r\n @trpc/react-query: ^10.33.0 => 10.33.0 \r\n @trpc/server: ^10.33.0 => 10.33.0 \r\n next: ^13.4.7 => 13.4.7 \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\n## Context\r\nI am currently experiencing an issue with the blog example provided by tRPC. When accessing a specific article using the URL, for example by refreshing the page /post/post_id, two calls are made to trpc.post.byId.useQuery. One call is made with the correct article ID extracted from the URL, while the other call is made with an 'undefined' value.\r\n***\r\nThis issue occurs only when SSR (Server-Side Rendering) is set to false in the configuration file located at @/lib/trpc.ts\r\n***\r\n\r\n## Expected Behavior\r\nWhen accessing a specific article using the URL, I expect trpc.post.byId.useQuery to correctly use the extracted article ID from the URL to make a single API call.\r\n\r\n## Current Behavior\r\nWhen accessing a specific article using the URL, two trpc.post.byId.useQuery calls are made. One call succeeds using the extracted article ID from the URL, while the other fails with an error as it receives an 'undefined' value for the article ID.\r\n\r\n### Link to reproduction\r\n\r\nhttps://stackblitz.com/github/trpc/examples-next-prisma-starter\r\n\r\n### To reproduce\r\n\r\nRun the blog example provided by tRPC.\r\n[examples-next-prisma-starter](https://github.com/trpc/examples-next-prisma-starter)\r\nAccess a specific article using the URL, for example by refreshing the page http://localhost:3000/post/4d9a7d67-7a12-4f17-b88b-32132ae0445f\r\nObserve the calls to trpc.post.byId.useQuery and any errors in the browser console.\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!",[3095],{"name":3067,"color":3068},4592,"bug: handling 'undefined' values in the blog example when (ssr: false)","2025-03-20T15:41:47Z","https://github.com/trpc/trpc/issues/4592",0.6608507,{"description":3102,"labels":3103,"number":3104,"owner":3023,"repository":3023,"state":3042,"title":3105,"updated_at":3106,"url":3107,"score":3108},"### Provide environment information\n\nSystem:\r\n OS: macOS 12.4\r\n CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz\r\n Memory: 36.45 MB / 8.00 GB\r\n Shell: 5.8.1 - /bin/zsh\r\n Binaries:\r\n Node: 18.10.0 - ~/Desktop/predictionBook/backend/node_modules/.bin/node\r\n Yarn: 1.22.19 - /usr/local/bin/yarn\r\n npm: 8.19.2 - /usr/local/bin/npm\r\n Watchman: 2022.10.31.00 - /usr/local/bin/watchman\r\n Browsers:\r\n Chrome: 108.0.5359.124\r\n Firefox: 108.0.1\r\n Safari: 15.5\n\n### Describe the bug\n\n\r\nClient package\r\n```\r\n\"@craco/craco\": \"^6.4.5\",\r\n \r\n \"@trpc/client\": \"^9.27.4\",\r\n \"@trpc/server\": \"^9.27.4\",\r\n \"@types/jest\": \"^27.0.1\",\r\n \"@types/node\": \"^16.7.13\",\r\n \"typescript\": \"^4.4.2\",\r\n \"zod\": \"^3.19.1\"\r\n```\r\n\r\nBackend package \r\n```\r\n \"@trpc/client\": \"^9.27.4\",\r\n \"@trpc/server\": \"^9.27.4\",\r\n \"dotenv\": \"^16.0.3\",\r\n \"express\": \"^4.18.2\",\r\n \"node\": \"^18.10.0\",\r\n \"nodemon\": \"^2.0.20\",\r\n \"jest\": \"^29.3.1\",\r\n \"zod\": \"^3.19.1\"\r\n```\r\n\r\nThe issue is that in my apiTests.test.ts file (using Jest), my client.mutation call is not working as intended. \r\nFor some reason its not adopting the types from the router, despite context being provided. In the example below, it says that \"Argument of type '{ email?: string; password?: string; }' is not assignable to parameter of type 'undefined'\"\r\nThe part that's tripping me is that this works just fine in my front-end code, where this exact same call is made and works.\r\n\r\nconst launchClient = createTRPCClient\u003CLaunchRouter>({\r\n url: `http://localhost:${PORT}/v1/launch`,\r\n});\r\n\r\ntest(\"Login and Signup\", async()=> {\r\n\r\n const email = randEmail()\r\n const password = randPassword() + '@'\r\n const name = randUserName()\r\n\r\n\r\n const apiReq:api.LoginRequest = {email, password}\r\n await expect(await launchClient.mutation('login',apiReq)).rejects.toThrow(\"FORBIDDEN\")\r\n \r\n})\n\n### Link to reproduction\n\nhttps://stackblitz.com/github/trpc/examples-next-minimal-starter?file=README.md\n\n### To reproduce\n\nI could not reproduce the bug\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!",[],3444,"bug: args_0 undefined","2022-12-20T23:50:41Z","https://github.com/trpc/trpc/issues/3444",0.66462255,["Reactive",3110],{},["Set"],["ShallowReactive",3113],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f2WvARHloFJSJaeFQ9C6Td5Dxf9LO3sk4Mr2JQZaj33M":-1},"/trpc/trpc/4826"]