Running TRPC on Vercel with custom serialization fails
Hi all,
I'm having some difficulties with the serialization of my objects when I run on vercel.
I'm running nextjs 13.4.4 with trpc/server,client,next 10.28.1 and the next page routing.
I'm using a custom type "ts-money" which is returned in a trpc response like:
3 Replies
I have implemented a custom serialization for it like so:
It is injected in my singleton client (Using T3 approach) like so:
When I run it locally everything works as expected... But when deployed on vercel the custome serialization is not executed.
I have added some logging and I can see the injection of custom serialization happening the first time I use a trpc route
api.xxxx
But the custom serilization does not take place. Any idea where I could start digging?Check here https://github.com/trpc/trpc/blob/next13-auth/examples/next-13-starter/src/trpc/shared.ts
GitHub
trpc/examples/next-13-starter/src/trpc/shared.ts at next13-auth ยท t...
๐งโโ๏ธ Move Fast and Break Nothing. End-to-end typesafe APIs made easy. - trpc/examples/next-13-starter/src/trpc/shared.ts at next13-auth ยท trpc/trpc
Hi Julius, I will try this. Thanks for sharing.๐
This did resolve my issue. thanks for sharring this example.