Open krthush opened 3 years ago
Hi @krthush, thank you for reporting this! Decimals are indeed not supported at the moment, but should be relatively straight-forward to add by adding a new entry to this file: https://github.com/blitz-js/superjson/blob/main/src/transformer.ts
Would you be interested in contributing a PR for this? Would love your help on it :)
Hi @Skn0tt , sounds good - a bit tight with time at the moment (since this issue isn't our highest priority atm) but yeah this is something I'll likely look into - will try to contribute a PR when I can!
tried to use superjson as a solution for this issue https://github.com/vercel/next.js/issues/11993, as suggested in https://github.com/blitz-js/superjson#using-with-nextjs
unfortunatly ran into issue with serialization of the Decimal data type as shown by the below error:
would be great if superjson supported this? or am I doing something wrong?
I'd rather not resort to have to using maps as shown in this fix https://github.com/prisma/prisma-examples/issues/3047 and our current fallback of
JSON.parse(JSON.stringify(result)
is somewhat inefficient I imagine