NextJS & Axios Error 500 after deploy when POST to /api


With NextJS 13 (, I’m using Axios to connect with functions inside ‘/api’. On localhost, the application works correctly, but after deploying I start getting 500 errors in the browser when trying to login or register, for example.

Error: to {message: ‘Request failed with status code 500’, name: ‘AxiosError’, code: ‘ERR_BAD_RESPONSE’, config: {…}, request: XMLHttpRequest, …}

I’ve been lost for a few days now and I’ve tried several solutions, but none of them really worked.

Thank you for your attention and, above all, for your time!

Did you check your function logs Function details | Functions | uspparty | Netlify: