Open sarioglu opened 2 months ago
Hi @sarioglu , I understand it's not ideal, but feel that over all it's worth the reduced bundle size. A workaround could be use the string constructor?
new Prisma.Decimal(someDecimalComingFromZenstack?.toString() ?? aNumber)
Hi 👋 Thank you for your response. I did that as an interim solution. But it won't prevent us from having the same issue in the future. I wonder if there's another way to make sure Decimal-light works with Decimal.
Description and expected behavior I saw that @zenstackhq/runtime replaced decimal.js with its light version. This breaks the compatibility with Prisma. I use nextjs app router with prisma on server-side and zenstack with swr on client-side for things like modals, etc. For some scenarios I use a conversion like
new Prisma.Decimal(someDecimalComingFromZenstack ?? aNumber)
. With 2.5.0 such conversions does not work because decimal.js checks if input to constructor is instanceof Decimal.Environment (please complete the following information):
Additional context Add any other context about the problem here.