\r\n \u003CProviders>{children}\u003C/Providers>\r\n \u003C/body>\r\n \u003C/html>\r\n );\r\n}\r\n```\r\n\r\nAnd this is our providers.tsx\r\n\r\n```\r\n\"use client\";\r\n\r\nimport { useEffect, useMemo, useState } from \"react\";\r\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\r\nimport { unstable_httpBatchStreamLink } from \"@trpc/client\";\r\nimport SuperJSON from \"superjson\";\r\n\r\nimport { getBaseUrlServer } from \"~/utils/getBaseUrl\";\r\nimport { createBrowserComponentClient } from \"~/utils/supabase-client\";\r\nimport { api } from \"~/utils/trpc-client\";\r\n\r\nexport const Providers = ({ children }: { children: React.ReactNode }) => {\r\n const [queryClient] = useState(\r\n () =>\r\n new QueryClient({\r\n defaultOptions: {\r\n queries: {\r\n staleTime: 15 * 1000,\r\n },\r\n },\r\n }),\r\n );\r\n\r\n const [authToken, setAuthToken] = useState\u003Cstring | undefined>();\r\n\r\n const trpcClient = useMemo(() => {\r\n return api.createClient({\r\n transformer: SuperJSON,\r\n links: [\r\n unstable_httpBatchStreamLink({\r\n url: `${getBaseUrlServer()}/api/trpc`,\r\n headers: {\r\n Authorization: `Bearer ${authToken}`,\r\n },\r\n }),\r\n ],\r\n });\r\n }, [authToken]);\r\n\r\n const supabase = createBrowserComponentClient();\r\n useEffect(() => {\r\n const {\r\n data: { subscription },\r\n } = supabase.auth.onAuthStateChange((_, session) => {\r\n if (session) {\r\n setAuthToken(session.access_token);\r\n }\r\n });\r\n\r\n return subscription.unsubscribe;\r\n }, [supabase.auth]);\r\n\r\n return (\r\n \u003Capi.Provider client={trpcClient} queryClient={queryClient}>\r\n \u003CQueryClientProvider client={queryClient}>{children}\u003C/QueryClientProvider>\r\n \u003C/api.Provider>\r\n );\r\n};\r\n```\r\n\r\nAgain this is the root layout, so anything we render should be under `QueryClientProvider`. \r\n\r\nAny idea why we're getting this error?\r\n\r\n### Link to reproduction\r\n\r\nhttps://stackblitz.com/github/trpc/examples-next-minimal-starter?file=README.md\r\n\r\n### To reproduce\r\n\r\nUnsure how to reproduce because as I said locally using `next dev` everything works.\r\n\r\nAlso unsure if this issue should be here or in nextjs.\r\n\r\nAny help would be appreciated\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!",[3086,3089,3092],{"name":3087,"color":3088},"๐ป invalid","e4e669",{"name":3090,"color":3091},"โฎ needs reproduction","000055",{"name":3093,"color":3094},"๐ bug: unconfirmed","e99695",5597,"bug: Error: No QueryClient set, use QueryClientProvider to set one","https://github.com/trpc/trpc/issues/5597",0.66632456,{"description":3100,"labels":3101,"number":3103,"owner":3025,"repository":3025,"state":3078,"title":3104,"updated_at":3105,"url":3106,"score":3107},"### Area of Improvement\n\n\r\nI would like to see how to add tRPC to newest NextJS which use `app-router` default\n\n### Link to related docs\n\nhttps://trpc.io/docs/client/nextjs\n\n### Additional information\n\n_No response_\n\n### ๐จโ๐งโ๐ฆ Contributing\n\n- [ ] ๐โโ๏ธ Yes, I'd be down to file a PR implementing the suggested changes!",[3102],{"name":3019,"color":3020},4730,"docs: update Nextjs intergration guide with app-router","2025-03-20T15:41:52Z","https://github.com/trpc/trpc/issues/4730",0.69418603,{"description":3109,"labels":3110,"number":3113,"owner":3025,"repository":3025,"state":3078,"title":3114,"updated_at":3115,"url":3116,"score":3117},"### Provide environment information\n\n System:\r\n OS: macOS 13.4\r\n CPU: (8) arm64 Apple M1 Pro\r\n Memory: 408.00 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 - ~/.yarn/bin/yarn\r\n npm: 9.6.7 - ~/.npm-global/bin/npm\r\n Browsers:\r\n Chrome: 116.0.5845.187\r\n Safari: 16.5\r\n\r\nBun 1.0.0\r\n@trpc/client: 10.38.2\r\n@trpc/server: 10.38.2\r\nreact: 18.2.0\r\nnext: 13.4.19\r\ntypescript: 5.1.6\n\n### Describe the bug\n\nI'm attempting to use tRPC in a new project using [bun 1.0.0](https://bun.sh/) workspaces... I created a [minimal reproduction of the error](https://github.com/jalexw/trpc-minimal-error) from my private project:\r\n\r\n\r\n\r\ntRPC correctly sends a batch request, the server responds to it correctly, but the client appears to throw an uncaught error in parsing the response.\r\n\r\nOn the client:\r\n```typescript\r\nawait trpcContext.client.greeting.query({ name });\r\n```\r\n\r\nOn the server:\r\n```typescript\r\nexport const appRouter = router({\r\n greeting: publicProcedure\r\n .input(\r\n z.object({\r\n name: z.string(),\r\n }),\r\n )\r\n .query(async (opts) => {\r\n console.log(\"Received greeting request\");\r\n return {\r\n message: `Greetings ${opts.input.name}, from the tRPC server!`\r\n }\r\n }),\r\n});\r\n```\r\n\r\n\r\n\r\n\n\n### Link to reproduction\n\nhttps://github.com/jalexw/trpc-minimal-error\n\n### To reproduce\n\n```bash\r\ngit clone https://github.com/jalexw/trpc-minimal-error.git\r\ncd trpc-minimal-error\r\nbun install\r\n\r\n# Build types and client for tRPC server into package for frontend Next app\r\nbun run refresh-trpc-client\r\n```\r\n\r\n\r\nStart the backend tRPC server and the frontend Next app server. Run the next two commands (in 2 separate terminals):\r\n\r\n```bash\r\n# Start the tRPC backend dev server on port 8080\r\nbun run dev:server\r\n```\r\n\r\n```bash\r\n# Start the Next.js frontend dev server (in a new shell) on port 3000 \r\nbun run dev:web\r\n```\r\n\r\n\n\n### Additional information\n\nThoughts?\r\n\r\nStop using Bun and switch back to Yarn? Are my build settings incorrect? CORS issue?\r\n\r\n1. As you can see in the earlier screenshot's error log, the response is being received by the client... I'm going to keep investigating this to try to get it working, but I thought that I would make an issue in case anyone else has experienced this...\n\n### ๐จโ๐งโ๐ฆ Contributing\n\n- [X] ๐โโ๏ธ Yes, I'd be down to file a PR fixing this bug!",[3111,3112],{"name":3087,"color":3088},{"name":3090,"color":3091},4809,"bug: bun workspaces - Uncaught (in promise) TRPCClientError: Unexpected end of input at TRPCClientError.from","2025-03-20T15:41:56Z","https://github.com/trpc/trpc/issues/4809",0.70097566,{"description":3119,"labels":3120,"number":3122,"owner":3025,"repository":3025,"state":3078,"title":3123,"updated_at":3124,"url":3125,"score":3126},"### Area of Improvement\n\nWith the new version of **nextjs (13)** you choose not to use the _app file, updating the documentation on that aspect to show how to integrate it is important.\n\n### Link to related docs\n\nhttps://trpc.io/docs/client/nextjs/setup\n\n### Additional information\n\nOn the point 5. Configure `_app.tsx`\n\n### ๐จโ๐งโ๐ฆ Contributing\n\n- [ ] ๐โโ๏ธ Yes, I'd be down to file a PR implementing the suggested changes!",[3121],{"name":3019,"color":3020},4571,"Update integration with nextjs","2025-03-20T15:41:46Z","https://github.com/trpc/trpc/issues/4571",0.70905006,["Reactive",3128],{},["Set"],["ShallowReactive",3131],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fosIpWDqC5kriJt5KQ_azBp-y9hY1dkwhFTPcDIdzN5M":-1},"/trpc/trpc/1963"]