API Routes (app router)
Answered
Asari posted this in #help-forum
AsariOP
Why am I getting a "Value is not JSON serializable" error? 2 Images
Answered by Arinji
you cant parse undefined as Json, hence your catch block is getting called
8 Replies
can you log result and show us the output @Asari
@Arinji can you log result and show us the output <@803612750718697493>
AsariOP
When I log await request.json() i get
const result = await db.....
log the result after you await it
log the result after you await it
see the issue xD?
you cant parse undefined as Json, hence your catch block is getting called
Answer
AsariOP
oh wtf... ty lmao i have no clue how i didn't realise this tbh
thx