Next.js Discord

Discord Forum

500 on POST: Prisma + mysql + nextjs

Answered
Rex posted this in #help-forum
Open in Discord
Avatar
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
Image
Image
Image
Image
Answered by Rex
Got it!
The problem was that I was using NextRequest and req.json .
Instead of Request and await req.json()
View full answer

3 Replies

Avatar
Southern rough shrimp
Look at the server error logs
Avatar
RexOP
Where? Cause now I'm on localhost
Avatar
RexOP
Got it!
The problem was that I was using NextRequest and req.json .
Instead of Request and await req.json()
Answer