← 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

How to fix it

  1. Open Vercel dashboard → your deployment → Logs, and find the stack trace for the request.

  2. 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 });
      }
    }
  3. Verify every runtime env var exists for the environment (Production vs Preview).

Related errors

Get new fixes weekly

No spam. Unsubscribe anytime. Privacy