500 on POST: Prisma + mysql + nextjs
Answered
Rex posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
RexOP
Hi, I'm trying to make an API call to create a new Category in my app, but when I try I get 500.
It's strange because payload is right
It's strange because payload is right
![Image](https://cdn.discordapp.com/attachments/1210297245635838043/1210297245929447476/image.png?ex=65ea0c25&is=65d79725&hm=00a1dda5ec3bebabe5bc29bdd40af310a782896f5a52e6ca0acb48d32e49c5a2&)
![Image](https://cdn.discordapp.com/attachments/1210297245635838043/1210297246403268668/image.png?ex=65ea0c25&is=65d79725&hm=6441740387d4ad4882eeed71da960ce8e4c9cf9e21c0e2e90e511389b114284c&)
![Image](https://cdn.discordapp.com/attachments/1210297245635838043/1210297246671962234/image.png?ex=65ea0c25&is=65d79725&hm=4f292adcc3ce107dbbe9d87aa4d0a34177e03f8cc9f603cb4e27d7df6acef30c&)
![Image](https://cdn.discordapp.com/attachments/1210297245635838043/1210297247057711184/image.png?ex=65ea0c25&is=65d79725&hm=7e59b5e63058e32222a1113597c18c212f0d6b67e770cae69aea9b639d1f1127&)
Answered by Rex
Got it!
The problem was that I was using NextRequest and req.json .
Instead of Request and await req.json()
The problem was that I was using NextRequest and req.json .
Instead of Request and await req.json()
3 Replies
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
Southern rough shrimp
Look at the server error logs
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
RexOP
Where? Cause now I'm on localhost
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
RexOP
Got it!
The problem was that I was using NextRequest and req.json .
Instead of Request and await req.json()
The problem was that I was using NextRequest and req.json .
Instead of Request and await req.json()
Answer