Functions work in dev but immediate 500 once deployed

Site name: dm-app-ui-testing

My functions work locally in dev, but when deployed they generate immediate 500 errors. I see the functions listed in the Netlify UI under Logs → Functions but no logs are recorded.

I created a test function that just returns an Ok message but that fails as well.

The site is deployed automatically from github repo. I read something about deploying from the command line and I tried that, didn’t get any errors on deploy, but the whole site failed to load so I went back to the auto github deploys.

adding /api/* /api/:splat 200 line to my _redirects file solved it for me:

/api/* /api/:splat 200
/* /index.html 200

My functions are configured to the api endpoint.
I assume if you were accessing them through the netlify/functions endpoint the line would be /netlify/functions/* /netlify/functions/:splat 200

1 Like