← All errors · Vercel
FUNCTION_INVOCATION_FAILED (500)
Exact error
500: INTERNAL_SERVER_ERROR. Code: FUNCTION_INVOCATION_FAILED
What it means
Your serverless function threw an unhandled error or crashed.
Likely causes
- An uncaught exception in an API route or server component.
- Missing env var at runtime (e.g. undefined API key).
- Importing a native/binary module unsupported in the runtime.
How to fix it
Open Vercel dashboard → your deployment → Logs, and find the stack trace for the request.
Wrap handler logic and return a useful error:
export async function GET() { try { const data = await doWork(); return Response.json(data); } catch (err) { console.error(err); return Response.json({ error: 'Internal error' }, { status: 500 }); } }Verify every runtime env var exists for the environment (Production vs Preview).
Related errors
Get new fixes weekly
No spam. Unsubscribe anytime. Privacy