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! 😄
10 Replies
This is my context definition:
You are trying to use CreateFastifyContextOptions where you should be using NodeHTTPCreateContextOptions
Oh, thanks! Will that not cause any issues though? As I'm using fastify trpc adapter for my project?
you're importing the standalone adapter, not the fastify adapter
I couldn't seem to find any fastify equivalent http function from the fastify adapter library
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 reproAh!!
This might be me not looking further than my nose! 🤣
I'll try this out, many thanks
Absolutely perfect! Everything works like a well oiled machine now!! Thanks so much