500: INTERNAL_SERVER_ERROR / FUNCTION_INVOCATION_FAILED on Vercel
Live site shows 500 FUNCTION_INVOCATION_FAILED but works locally? Your server code crashed. Read the runtime logs, then check env vars.
Reviewed October 14, 2026
What it means in plain English
Your server code threw an error and crashed. The logs tell you exactly why; the page itself doesn't.
Likely causes
- A missing env var (code reads
undefined). - A package that only works locally or needs a different Node.js version.
- Database unreachable or out of connections.
How to fix it, step by step
- Vercel → Project → Logs (runtime) → filter by the failing path → read the error message and stack trace.
- If it mentions
undefinedor a missing key: add the env var for Production and redeploy. - If it's a Node version issue: set it in Project Settings or
package.json"engines": { "node": "22.x" }. - If it's database connections, see the 'too many connections' page.
- Paste the exact log error into Cursor/v0 and ask for a fix, rather than describing the symptom.
How to check it worked
- The route returns 200 and the logs are clean.
Sources
Related fixes
Can't fix it? Get help.
If the steps didn't clear the error, send what the screen says. A person can take a look. This is a request for a paid fix, not an instant chat.