Deployed NextJS app's API returns 404 #41781
-
Hey everyone, Any idea why else could this happen? Front-end is sending a |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
Same to you. Did you solve? I am also stacked as the same like you'd facing this issues on the productions. Even is a just simple api routes but that returned as 404 not found in the production. |
Beta Was this translation helpful? Give feedback.
-
Maybe this is a problem in version 13? I also have this problem. |
Beta Was this translation helpful? Give feedback.
-
The issue was not with API routes - the issue is that Vercel is masking unhandled exceptions to |
Beta Was this translation helpful? Give feedback.
-
Okay, so to fix this issue:
|
Beta Was this translation helpful? Give feedback.
-
Facing the same issue, it works most of the time, but sometimes it will return 404 page as the request's response, annoying. |
Beta Was this translation helpful? Give feedback.
The issue was not with API routes - the issue is that Vercel is masking unhandled exceptions to
404
. So if something bad happens on back-end and you do not catch the exception AND returrn it to front-end you will never know what actually happened.