Redirected false error 400
I don't understand why I cannot create a document
Solution:Jump to solution
After some troubleshooting the problem was caused by a type error as prisma was being passed a string instead of an object. After parsing the json string there was a different type error introduced by using connect instead of idEnvelope.
22 Replies
Could you send the full error you a receiving to help narrow down where the problem is occurring, I suspect your a missing a required field in your query.
the error is here, when I fetch it return internal server error
but when I create a user it work perfect, idem for the envelope and it the same, but for the document it don't want to work
In the api endpoint your fetching you have a try catch statement which returns status 500 are you able to confirm if that code is being executed?
no
because just before I add a console.log and I don't see it
I remove the ty catch
Okay this would suggest that the error is unrelated to your prisma query and could be caused by something like middlewares etc
it's the line 117 who make this message
ok so what can i do ?
I would console.log res and see what the output is and then trace the http request to see what code is being executed before it gets to your prisma query
By trace the http request I mean go from the entrypoint of your application e.g index.js/server.js and follow the path the request would make and add some temporary console.logs in any code that is executed before hand to narrow down where the Internal server error is being sent from
I not sure how to do that. In fact I'm a beginner I don't think I understand
but is there any doc to follow ?
Erm I will have a look see if i can find any resource for you
or maybe It's because of the need of the envelope to create the document
If it was the try catch would of triggered giving you a verbose prisma error
I see
thanks you very much
I can jump on a call and walk you through what I mean if youd like
ow of course I ok with that
meet ?
Sent you a friend request
I think I accept
Solution
After some troubleshooting the problem was caused by a type error as prisma was being passed a string instead of an object. After parsing the json string there was a different type error introduced by using connect instead of idEnvelope.