Decimal Warning
I'm trying to figure out this error:
Warning: Only plain objects can be passed to Client Components from Server Components. Decimal objects are not supported.I have some prisma decimals so I tried some of the fixes to the superjson transformer using Decimal.js, but it didn't make the warnings go away. I haven't run into an actual problem yet though so I'm confused. Any suggestions? thanks
1 Reply
I was able to make the error go away by
JSON.parse(JSON.stringify(myDataWithDecimals))
when passing from the server to client component. Feels like a hack though.
ugh. The JSON stringify is breaking date objects so I've just moved the problem.