Jack
Jack5mo ago

Type error when creating a server-side context 🤔

I am trying to set up my context for TRPC server, and I get the attached error. I am using TRPC v10, Node 20.7.0, TS 5.3.3 and Fastify for the API server. It seems the createHTTPHandler import is only suitable for vanilla HTTP module typings? Thanks for the help! 😄
No description
10 Replies
Jack
Jack5mo ago
This is my context definition:
No description
BeBoRE
BeBoRE5mo ago
You are trying to use CreateFastifyContextOptions where you should be using NodeHTTPCreateContextOptions
Jack
Jack5mo ago
Oh, thanks! Will that not cause any issues though? As I'm using fastify trpc adapter for my project?
Alex / KATT 🐱
you're importing the standalone adapter, not the fastify adapter
Jack
Jack5mo ago
I couldn't seem to find any fastify equivalent http function from the fastify adapter library
Jack
Jack5mo ago
No description
Jack
Jack5mo ago
I did try fastifyRequestHandler to no avail :( If you don't mind my jumping ahead, is fastify not 100% supported? Thanks for the help Alex!! I'll see if I can spin up a stackblitz repro
Jack
Jack5mo ago
Ah!! This might be me not looking further than my nose! 🤣 I'll try this out, many thanks
Jack
Jack5mo ago
Absolutely perfect! Everything works like a well oiled machine now!! Thanks so much
No description
More Posts
The inferred type of 'trpc' cannot be named without a referenceI'm getting the same error as this post: https://discord.com/channels/867764511159091230/11707368517how to solve thismy query is declared right when i go to this url localhost:3000/api/trpc/gethello i get my output bis it possible to set a response middleware on Vanilla trpc client?I have a vue app and I want to set a middleware on the response, whenever I get a response if I findBug: Setting up cookies not woring when using .input in nextjsHey guys I am trying to set up a cookie with nextjs 14 and trpc. However my cookie is only being setWhat's the best practices around tRPC to negotiate API-versions?In my example I'm thinking about having a native app as a tRPC client and a locally deployed docker Is there a way to pass context or cookies to the client provider?```typescript export default function APIProvider({ children, }: { children: React.ReactNode; })Is there a way to pass context or cookies to the client provider?```typescript export default function APIProvider({ children, }: { children: React.ReactNode; })Why deprecate experimental_standaloneMiddleware?I am reading https://trpc.io/docs/server/middlewares#experimental-standalone-middlewares, but it's sshared useTRPCClient hook conversion to v11In our mono repo, we have 30 or so MFEs which all use the same TRPC client setup. So, we abstracted Question: Is there a way to have a base interface for Trpc router?Hi, So I am trying to see if there is way to keep methods inside trpc routes consistent, Like in ca