frankind.eth | Franco Aguzzi
frankind.eth | Franco Aguzzi
TtRPC
Created by frankind.eth | Franco Aguzzi on 5/31/2023 in #❓-help
How to retrieve and receive Bigint data to/from TRPC procedure
Hi @NEO I've added something very similar (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#use_within_json) to the code snippet you've shared and the issue was fixed! 🥳 Thanks so much for your help @nlucas and @NEO, I really appreciate it! trpc
11 replies
TtRPC
Created by frankind.eth | Franco Aguzzi on 5/31/2023 in #❓-help
How to retrieve and receive Bigint data to/from TRPC procedure
I've extracted the registration of this custom type to a file which is being imported in both client and server TRPC configuration files, but the error below persists: TypeError: Do not know how to serialize a BigInt I wonder if this is related to TRPC procedures config, to SuperJson lib (which should give support to BigInt without the need of registering new custom serialize/deserialize function for it, as mentioned in their docs: https://github.com/blitz-js/superjson#examples-3) or to Next.js Neither SuperJson, TRPC nor Next.js Github issues contain related issues, so I'm finding myself completely stuck in this limitation now 😮‍💨
11 replies
TtRPC
Created by frankind.eth | Franco Aguzzi on 5/31/2023 in #❓-help
How to retrieve and receive Bigint data to/from TRPC procedure
@Nick Lucas Adding the following code wasn't enough for getting rid of the error: TypeError: Do not know how to serialize a BigInt registerCustom<bigint, string>( { isApplicable: (v): v is bigint => typeof v === "bigint", serialize: (v) => v.toString(), deserialize: (v) => BigInt(v), }, "bigint", ); Do you have any other suggestion on how to fix this issue? I'm send attached to this message my TRPC server file + TRPC client file so you can have more visibility of how I'm implementing things here 👍
11 replies
TtRPC
Created by frankind.eth | Franco Aguzzi on 5/31/2023 in #❓-help
How to retrieve and receive Bigint data to/from TRPC procedure
Hey @Nick Lucas ! I appreciate your quick response, I'll take a look on this now and let you know in what it results 😉
11 replies