1 year ago

#364871

test-img

pedrosc94

Problem reading from rest api with autogenerated BigInt Id

I'm having some issues with my rest api when I try to read from database. My server stack right now is NestJS + Prisma + Cockroachdb

At first when I generated a new User, with a POST, all went great and got it to go to my database. 1 But when I tried to read from it it went really wrong and gave me an error, saying that couldn't serialize a BigInt.

I googled a lot and found a fix for it ('json-bigint-patch'), but now instead of getting an error it just returns me 'null'. 2

Later I found out if I manually change the autogenerated ID for a smaller number, I get the result as I was expecting. 3

So right now I'm stuck with this and I dont know how to solve this issue.

Thanks for your help in advance

Note: I'm really new at all this

typescript

nestjs

prisma

bigint

cockroachdb

0 Answers

Your Answer

Accepted video resources