;\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.6589591,{"description":3086,"labels":3087,"number":3089,"owner":3050,"repository":3050,"state":3072,"title":3090,"updated_at":3091,"url":3092,"score":3093},"### Provide environment information\n\n```\r\n System:\r\n OS: Linux 6.8 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)\r\n CPU: (16) x64 AMD Ryzen 7 5800X 8-Core Processor\r\n Memory: 16.91 GB / 31.24 GB\r\n Container: Yes\r\n Shell: 5.8.1 - /usr/bin/zsh\r\n Binaries:\r\n Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node\r\n Yarn: 3.3.1 - ~/.nvm/versions/node/v20.12.2/bin/yarn\r\n npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm\r\n Browsers:\r\n Brave Browser: 131.1.73.104\r\n Chrome: 131.0.6778.204\r\n npmPackages:\r\n @tanstack/react-query: latest => 5.62.7 \r\n @trpc/client: next => 11.0.0-rc.666+99556c074 \r\n @trpc/next: next => 11.0.0-rc.666+99556c074 \r\n @trpc/react-query: next => 11.0.0-rc.666+99556c074 \r\n @trpc/server: 11.0.0-rc.608 => 11.0.0-rc.608+f75de97b3 \r\n next: ^15.1.2 => 15.1.2 \r\n react: ^19.0.0 => 19.0.0 \r\n typescript: ^5.7.2 => 5.7.2 \r\n```\r\n\n\n### Describe the bug\n\nWhen i call my API, deployed to Netlify, i get this error: `{\"error\":{\"json\":{\"message\":\"req.socket.once is not a function\",\"code\":-32603,\"data\":{\"code\":\"INTERNAL_SERVER_ERROR\",\"httpStatus\":500}}}}`. It comes from the code, introduced in those 2 commits/lines: \r\nhttps://github.com/trpc/trpc/commit/87fde62978441b1cedd1d5cf7290f6ade9a92607#diff-981f2f06bfbbee188e14a4f7991f370e9042eb5c21995e24e183ab76acc5ce01R136\r\nhttps://github.com/trpc/trpc/commit/3df8b21beb4925cf73194fc776d1a88603a3c420#diff-981f2f06bfbbee188e14a4f7991f370e9042eb5c21995e24e183ab76acc5ce01L136\r\nSo downgrading `@trpc/server` and pinning to `11.0.0-rc.608` (version before those lines were introduced) helps with this issue. \r\nIt seems like `req` object in AWS/Netlify environment is an instance of `ComputeJsIncomingMessage` class, which doesn't have `socket` property. \r\nAlso worth mentioning that issue is happening only in API routes (`[trpc].ts`), and SSR with `createServerSideHelpers` / ` await helpers.user.get.prefetch(id);` works fine\n\n### Link to reproduction\n\n-\n\n### To reproduce\n\nNo idea, probably create a new project with next and trpc, and deploy it to Netlify.\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!",[3088],{"name":3047,"color":3048},6341,"bug: trpc fails on nextjs API route, deloyed on AWS lambda, backed by netlify","2024-12-30T18:02:13Z","https://github.com/trpc/trpc/issues/6341",0.6664168,{"description":3095,"labels":3096,"number":3101,"owner":3050,"repository":3050,"state":3072,"title":3102,"updated_at":3103,"url":3104,"score":3105},"### 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!",[3097,3100],{"name":3098,"color":3099},"π» invalid","e4e669",{"name":3047,"color":3048},6441,"bug: TRPC with nextjs 15(App Router) production build failed!","2025-02-05T17:24:47Z","https://github.com/trpc/trpc/issues/6441",0.6688579,{"description":3107,"labels":3108,"number":3112,"owner":3050,"repository":3050,"state":3072,"title":3113,"updated_at":3114,"url":3115,"score":3116},"### Provide environment information\n\n```\r\n System:\r\n OS: macOS 13.2.1\r\n CPU: (8) arm64 Apple M1 Pro\r\n Memory: 550.84 MB / 16.00 GB\r\n Shell: 5.8.1 - /bin/zsh\r\n\r\n Binaries:\r\n Node: 16.19.0 - ~/.nvm/versions/node/v16.19.0/bin/node\r\n npm: 8.19.3 - ~/.nvm/versions/node/v16.19.0/bin/npm\r\n\r\n Browsers:\r\n Chrome: 111.0.5563.64\r\n Safari: 16.3\r\n\r\n npmPackages:\r\n @tanstack/react-query: ^4.26.1 => 4.26.1\r\n @trpc/client: ^10.14.1 => 10.14.1\r\n @trpc/next: ^10.14.1 => 10.14.1\r\n @trpc/react-query: ^10.14.1 => 10.14.1\r\n @trpc/server: ^10.14.1 => 10.14.1\r\n next: 13.2.4 => 13.2.4\r\n react: 18.2.0 => 18.2.0\r\n typescript: ^4.9.5 => 4.9.5\r\n```\n\n### Describe the bug\n\nUpdated next version to latest and just restarted the dev server, all queries seems broken.\r\n\r\nmight be related to [this issue](https://github.com/vercel/next.js/issues/46356)\r\n\u003Cimg width=\"1620\" alt=\"image\" src=\"https://user-images.githubusercontent.com/61357713/224341226-ace6e644-6a70-4eea-931e-af71d03929fb.png\">\r\n\n\n### Link to reproduction\n\ncompany code so can't share \n\n### To reproduce\n\nJust update to latest next version\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!",[3109],{"name":3110,"color":3111},"blocked","111111",3971,"Next.js bug: queries broken in next 13.2.4","2023-04-10T12:02:22Z","https://github.com/trpc/trpc/issues/3971",0.67208266,{"description":3118,"labels":3119,"number":3120,"owner":3050,"repository":3050,"state":3072,"title":3121,"updated_at":3122,"url":3123,"score":3124},"### Provide environment information\r\n\r\n```\r\n System:\r\n OS: macOS 13.3.1\r\n CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz\r\n Memory: 216.73 MB / 16.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 18.16.0 - ~/Library/Caches/fnm_multishells/7767_1683126064680/bin/node\r\n Yarn: 1.22.19 - ~/Library/pnpm/yarn\r\n npm: 9.5.1 - ~/Library/Caches/fnm_multishells/7767_1683126064680/bin/npm\r\n Browsers:\r\n Brave Browser: 107.1.45.127\r\n Chrome: 109.0.5414.119\r\n Firefox: 106.0\r\n Safari: 16.4\r\n npmPackages:\r\n @tanstack/react-query: 4.29.5 => 4.29.5\r\n @trpc/client: 10.25.0 => 10.25.0\r\n @trpc/next: 10.25.0 => 10.25.0\r\n @trpc/react-query: 10.25.0 => 10.25.0\r\n @trpc/server: 10.25.0 => 10.25.0\r\n next: 13.4.0 => 13.4.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\nUpgrading Next.js to 13.4 causes the project to not build.\r\nThe following error was repeated for several different routes:\r\n\r\n\u003Cdetails>\r\n\u003Csummary>Build Error (single example)\u003C/summary>\r\n\r\n```sh\r\nError occurred prerendering page \"/profile\". Read more: https://nextjs.org/docs/messages/prerender-error\r\nTypeError: Cannot read properties of null (reading 'useMemo')\r\n at exports.useMemo (/Users/joe/GitHub/InReach/monorepo/node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.production.min.js:25:208)\r\n at Object.useDehydratedState (file:///Users/joe/GitHub/InReach/monorepo/node_modules/.pnpm/@trpc+react-query@10.25.0_@tanstack+react-query@4.29.5_@trpc+client@10.25.0_@trpc+server@10.2_g6kbjzangqetmhsdt26x4s6jva/node_modules/@trpc/react-query/dist/createHooksInternal-ac3d45d9.mjs:517:29)\r\n at WithTRPC (/Users/joe/GitHub/InReach/monorepo/apps/app/.next/server/chunks/248.js:13429:38)\r\n at Ge (/Users/joe/GitHub/InReach/monorepo/node_modules/.pnpm/next@13.4.0_@opentelemetry+api@1.4.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:114:273)\r\n at Z (/Users/joe/GitHub/InReach/monorepo/node_modules/.pnpm/next@13.4.0_@opentelemetry+api@1.4.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:120:91)\r\n at Ge (/Users/joe/GitHub/InReach/monorepo/node_modules/.pnpm/next@13.4.0_@opentelemetry+api@1.4.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:115:9)\r\n at Z (/Users/joe/GitHub/InReach/monorepo/node_modules/.pnpm/next@13.4.0_@opentelemetry+api@1.4.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:120:91)\r\n at He (/Users/joe/GitHub/InReach/monorepo/node_modules/.pnpm/next@13.4.0_@opentelemetry+api@1.4.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:123:155)\r\n at Je (/Users/joe/GitHub/InReach/monorepo/node_modules/.pnpm/next@13.4.0_@opentelemetry+api@1.4.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:122:100)\r\n at Z (/Users/joe/GitHub/InReach/monorepo/node_modules/.pnpm/next@13.4.0_@opentelemetry+api@1.4.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.browser.production.min.js:120:222)\r\n```\r\n\r\nSummary of route errors:\r\n\r\n```sh\r\n> Export encountered errors on following paths:\r\n\t/_error: /404\r\n\t/_error: /500\r\n\t/_error: /ar/404\r\n\t/_error: /ar/500\r\n\t/_error: /en/404\r\n\t/_error: /en/500\r\n\t/_error: /es/404\r\n\t/_error: /es/500\r\n\t/_error: /fr/404\r\n\t/_error: /fr/500\r\n\t/_error: /ru/404\r\n\t/_error: /ru/500\r\n\t/profile\r\n\t/profile: /ar/profile\r\n\t/profile: /en/profile\r\n\t/profile: /es/profile\r\n\t/profile: /fr/profile\r\n\t/profile: /ru/profile\r\n\t/search\r\n\t/search: /ar/search\r\n\t/search: /en/search\r\n\t/search: /es/search\r\n\t/search: /fr/search\r\n\t/search: /ru/search\r\n```\r\n\r\n\u003C/details>\r\n\r\nRemoving the `withTRPC`\twrapper in `_app.tsx` allows the build to succeed. \r\n\r\n### Link to reproduction\r\n\r\nhttps://github.com/weareinreach/InReach/tree/renovate/next.js\r\n\r\n### To reproduce\r\n\r\nRun `pnpm build` from the `apps/app` directory in the monorepo.\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!",[],4316,"bug: Next.js 13.4 build errors","2023-05-19T18:02:05Z","https://github.com/trpc/trpc/issues/4316",0.67456216,{"description":3126,"labels":3127,"number":3128,"owner":3050,"repository":3050,"state":3072,"title":3129,"updated_at":3130,"url":3131,"score":3132},"### Provide environment information\n\n System:\r\n OS: Windows 10 10.0.22621\r\n CPU: (12) x64 AMD Ryzen 5 5600H with Radeon Graphics\r\n Memory: 6.68 GB / 13.86 GB\r\n Binaries:\r\n Node: 19.3.0 - C:\\Program Files\\nodejs\\node.EXE\r\n npm: 9.2.0 - C:\\Program Files\\nodejs\\npm.CMD\r\n Browsers:\r\n Edge: Spartan (44.22621.1413.0), Chromium (112.0.1722.34)\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.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.2.1 => 13.2.1 \r\n react: ^18.2.0 => 18.2.0 \r\n typescript: ^4.8.3 => 4.8.3 \n\n### Describe the bug\n\n\r\n\r\n\r\n\r\nThere are no props from MyApp.getInitialProps \n\n### Link to reproduction\n\nhttps://stackblitz.com/edit/github-apyaci?file=src%2Fpages%2F_app.tsx\n\n### To reproduce\n\nyarn create next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-starter trpc-prisma-starter\r\n\r\nThis can be reproduced in this example.\r\n\r\n const MyApp = (({ Component, pageProps, ...props }: AppPropsWithLayout) => {\r\n console.log(pageProps, props);\r\n \r\n const getLayout =\r\n Component.getLayout ?? ((page) => \u003CDefaultLayout>{page}\u003C/DefaultLayout>);\r\n \r\n return getLayout(\u003CComponent {...pageProps} />);\r\n }) as AppType;\r\n MyApp.getInitialProps = () => {\r\n return {\r\n someData: '123123',\r\n };\r\n };\r\nexport default trpc.withTRPC(MyApp);\r\n\r\n\r\n\r\nthis code should be in __app\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!",[],4159,"bug: getInitialProps in __app.tsx not work","2023-04-22T12:02:12Z","https://github.com/trpc/trpc/issues/4159",0.6766285,{"description":3134,"labels":3135,"number":3139,"owner":3050,"repository":3050,"state":3072,"title":3140,"updated_at":3141,"url":3142,"score":3143},"### Area of Improvement\n\nIn the docs all prefetch calls are always `void`ed while the tanstack docs `await` them. This makes it difficult to find out how to block page load before trpc queries are finished, especially when looking for pages router-like behavior after making the switch to app router. \n\n### Link to related docs\n\nhttps://trpc.io/docs/client/tanstack-react-query/server-components\n\n### Additional information\n\nThere's a good chance I'm missing something here and there's a better way to fetch certain trpc queries server-side before the html is being rendered to avoid empty state. There is an extensive explanation of my struggles on discord: https://discord.com/channels/867764511159091230/1356650745956532409\n\n### π¨βπ§βπ¦ Contributing\n\n- [ ] πββοΈ Yes, I'd be down to file a PR implementing the suggested changes!",[3136],{"name":3137,"color":3138},"π documentation / examples","0075ca",6655,"docs: Apparent lack of awaited prefetch in docs","2025-05-26T19:52:47Z","https://github.com/trpc/trpc/issues/6655",0.6837134,["Reactive",3145],{},["Set"],["ShallowReactive",3148],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$frvtmoreiac1e9LAvhyfXYcHr4If59rCk8PlVXjWL980":-1},"/trpc/trpc/3840"]