frankind.eth | Franco AguzziF
tRPCโ€ข3y agoโ€ข
10 replies
frankind.eth | Franco Aguzzi

How to retrieve and receive Bigint data to/from TRPC procedure

Node: v16.15.1

I'm trying to return an object which contains an amount property from one of my TRPC procedures... This property should retrieve a bigint. Unfortunately, I'm receiving error:

TypeError: Do not know how to serialize a BigInt

When doing this. I've already configured
superjson
Data transformer in my TRPC server instance creation and in client's
createTRPCNext
's response, but this didn't solve the problem.

What is the most appropriate way of receiving and returning bigint properties to/from my TRPC procedures inside my Next.js application?

I appreciate any help, thanks! ๐Ÿ™๐Ÿผ

These are my packages versions:
"@trpc/client": "10.14.1",
"@trpc/next": "10.14.1",
"@trpc/react-query": "10.14.1",
"@trpc/server": "10.14.1",
"next": "13.2.3",
"superjson": "1.12.3"
Was this page helpful?