# Vercel 500: Internal Server Error

> A Vercel 500 is usually FUNCTION_INVOCATION_FAILED or INTERNAL_UNEXPECTED_ERROR. Tell them apart, read the logs, and fix crashes and unhandled rejections.

Canonical: https://scaplet.com/errors/cdn/vercel-500

Guide Error · CDN and hosting errors

A Vercel 500 is usually FUNCTION_INVOCATION_FAILED or INTERNAL_UNEXPECTED_ERROR. Tell them apart, read the logs, and fix crashes and unhandled rejections.

3 min

read

4

sources

Nov 1, 2026

updated

Scaplet Editorial Team

author

In one line

A Vercel 500 usually shows FUNCTION_INVOCATION_FAILED, meaning a function invocation failed: the runtime crashed or Node.js or Bun threw an unhandled rejection or uncaught exception. Read the function's logs, wrap risky code in try/catch, and check environment variables. INTERNAL_UNEXPECTED_ERROR is the generic variant, and Vercel's documented step is to contact support with your deployment ID.

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fvercel-500%20(%22Vercel%20500%3A%20Internal%20Server%20Error%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fvercel-500%20(%22Vercel%20500%3A%20Internal%20Server%20Error%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fvercel-500%20(%22Vercel%20500%3A%20Internal%20Server%20Error%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fvercel-500%20(%22Vercel%20500%3A%20Internal%20Server%20Error%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

## At a glance

4 facts from the sources below

500

Status

FUNCTION_INVOCATION_FAILED

Main code

INTERNAL_UNEXPECTED_ERROR

Generic code

Function logs

First stop

_01_Vercel 500 codes from the error reference

## The two codes behind a Vercel 500

Vercel documents two platform 500s. The first points at your function, the second at the platform. Telling them apart takes ten seconds because the code is printed in the response body.

Code

### FUNCTION_INVOCATION_FAILED

Body shown

FUNCTION_INVOCATION_FAILED: Internal Server Error

What Vercel says

The invocation failed. Causes listed: the runtime process (Node.js, Bun, Python and others) crashed, or Node.js or Bun threw an unhandled rejection or uncaught exception

What to do

Read the function logs, fix the exception, check configuration and environment variables

Code

### INTERNAL_UNEXPECTED_ERROR

Body shown

INTERNAL_UNEXPECTED_ERROR: Internal Server Error

What Vercel says

An unexpected and unspecified internal error: system faults, unhandled exceptions or unforeseen issues

What to do

Contact Vercel support and supply your deployment ID

Which layer produced the 500

```
request -> Vercel edge -> function invocation | |-- your code threw, or runtime crashed ---> FUNCTION_INVOCATION_FAILED |-- unspecified platform fault -----------> INTERNAL_UNEXPECTED_ERROR |-- your code returned status 500 itself -> plain 500 from your app
```

The third branch matters. If your own handler returns a 500 response, no Vercel code appears in the body, and the fix is in your application logic rather than in anything platform-side.

_02_How it works

## Reproduce and read the evidence

Reader's own deployment: show status and the body that carries the code

```
curl -sS -i https://your-project.vercel.app/api/example | head -20
```

Public endpoint: a plain 500 for comparison (no Vercel code in the body)

```
curl -sS -o /dev/null -w "%{http_code}\n" https://httpbin.org/status/500 # expected output: 500
```

1. 01

### Capture the body and status

Run the `curl` below against the failing URL. A body that starts with a code name tells you which row of the table applies.
2. 02

### Open the logs

Vercel says application logs are under the **Logs** tab for the project, and also at the host URL under the `/_logs` path. Look for the stack trace at the time of the 500.
3. 03

### Find the unhandled path

Look for an `await` with no `catch`, a thrown error in a callback, or a crash at module load, for example reading an environment variable that is not set in that environment.
4. 04

### Compare environments

If preview works and production fails, check that each environment variable exists for the **Production** environment too.

_03_Your call

## Make the function fail loudly instead of crashing

Vercel's guidance for FUNCTION_INVOCATION_FAILED is to confirm the code is correct and free of infinite loops, use a `try/catch` around work that might throw, and look for unhandled exceptions. A handler that catches, logs the cause and returns a deliberate response gives you a readable log line instead of a crashed invocation.

If this fits

### Debug it yourself when

- The body shows FUNCTION_INVOCATION_FAILED
- Logs contain a stack trace or an unhandled rejection
- It started after a deploy or an environment variable change

Or

### Contact Vercel support when

- The body shows INTERNAL_UNEXPECTED_ERROR
- Logs show nothing from your code for the failing request
- You can supply the deployment ID and a failing URL

api/example.js: catch, log with context, respond on purpose

```
export default async function handler(req, res) { try { const data = await loadData(req.query.id); res.status(200).json(data); } catch (err) { console.error('example handler failed', { id: req.query.id, message: err.message }); res.status(500).json({ error: 'Could not load data' }); } }
```

**A caught 500 is still a 500**Returning your own 500 gives you control of the body and the log line, but crawlers and uptime monitors still see a server error. Use the status that matches the failure: 404 for a missing record, 400 for bad input, 500 only for faults that are yours.

_04_Explained

## What a 500 does to search visibility

Google says `5xx` and `429` server errors prompt its crawlers to temporarily slow down with crawling. Already indexed URLs that return them are preserved in the index but eventually dropped. A single failing API route matters little, but a 500 on a page template takes every URL built from it out of reach together. Use [5xx server errors](/seo-issues/server-errors-5xx) to list the affected URLs, and compare with [FUNCTION_INVOCATION_TIMEOUT](/errors/cdn/vercel-function-invocation-timeout), which is the slow-function sibling rather than the crashing one.

Questions

## Asked a lot.

3 questions people ask next, answered from the sources on this page.

_01_ What does FUNCTION_INVOCATION_FAILED mean on Vercel?

A function invocation failed. Vercel lists two causes: the runtime process crashed, or Node.js or Bun threw an unhandled rejection or uncaught exception. The fix starts in the function's logs.

_02_ How do I fix INTERNAL_UNEXPECTED_ERROR?

You cannot fix it from code. Vercel describes it as an unexpected and unspecified internal error and says to contact support with your deployment ID.

_03_ Where are Vercel function logs?

Under the Logs tab for the project in the dashboard, and Vercel's error pages also point to the `/_logs` path at the host URL.

Sources · 4

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- vercel.com
- google.com

1. 01 [Vercel docs: FUNCTION_INVOCATION_FAILED](https://vercel.com/docs/errors/FUNCTION_INVOCATION_FAILED) vercel.com · checked 2026-11-01
2. 02 [Vercel docs: INTERNAL_UNEXPECTED_ERROR](https://vercel.com/docs/errors/INTERNAL_UNEXPECTED_ERROR) vercel.com · checked 2026-11-01
3. 03 [Vercel docs: FUNCTION_THROTTLED (logs location)](https://vercel.com/docs/errors/FUNCTION_THROTTLED) vercel.com · checked 2026-11-01
4. 04 [How HTTP status codes affect Google's crawlers](https://developers.google.com/crawling/docs/troubleshooting/http-status-codes) developers.google.com · checked 2026-11-01

## Keep learning

[All errors](/errors)

[Learn Vercel 429: Too Many Requests CDN and hosting errors](/errors/cdn/vercel-429) [Related 5xx server errors Status codes and links](/seo-issues/server-errors-5xx) [Read next Vercel FUNCTION_INVOCATION_TIMEOUT CDN and hosting errors](/errors/cdn/vercel-function-invocation-timeout) [Do Run a free site audit Free, about two minutes](/site-audit)

Other 500 errors
[HTTP 500 Internal Server Error](/errors/http/500)

More Vercel errors
[Vercel: too many redirects](/errors/cdn/vercel-too-many-redirects) [Vercel 413: FUNCTION_PAYLOAD_TOO_LARGE](/errors/cdn/vercel-payload-too-large) [Vercel 429: Too Many Requests](/errors/cdn/vercel-429) [Vercel build failed](/errors/cdn/vercel-build-failed) [Vercel domain not working](/errors/cdn/vercel-domain-not-working)

More in CDN and hosting errors
[Google Cloud 502 Bad Gateway](/errors/cdn/google-cloud-502) [Heroku 503 Service Unavailable](/errors/cdn/heroku-503) [Heroku H10: App crashed](/errors/cdn/heroku-h10-app-crashed) [Heroku H12: Request timeout](/errors/cdn/heroku-h12-request-timeout) [Heroku H13: Connection closed without response](/errors/cdn/heroku-h13) [Heroku H14: No web processes running](/errors/cdn/heroku-h14) [Netlify build failed](/errors/cdn/netlify-build-failed) [Netlify function timeout](/errors/cdn/netlify-function-timeout) [Render 502 Bad Gateway](/errors/cdn/render-502) [S3 Access Denied (403 Forbidden)](/errors/cdn/s3-access-denied) [Vercel 413: FUNCTION_PAYLOAD_TOO_LARGE](/errors/cdn/vercel-payload-too-large) [Vercel 429: Too Many Requests](/errors/cdn/vercel-429) [Vercel 500: Internal Server Error](/errors/cdn/vercel-500) [Vercel build failed](/errors/cdn/vercel-build-failed) [Vercel domain not working](/errors/cdn/vercel-domain-not-working) [Vercel FUNCTION_INVOCATION_TIMEOUT](/errors/cdn/vercel-function-invocation-timeout) [Vercel: too many redirects](/errors/cdn/vercel-too-many-redirects) [Akamai reference number](/errors/cdn/akamai-reference-number) [ALB 503 Service Unavailable](/errors/cdn/alb-503) [ALB 504 Gateway Timeout](/errors/cdn/alb-504-gateway-timeout) [API Gateway 403 Forbidden](/errors/cdn/api-gateway-403-forbidden) [API Gateway 504 Gateway Timeout](/errors/cdn/api-gateway-504) [AWS 502 Bad Gateway](/errors/cdn/aws-502-bad-gateway) [AWS Amplify 404 Not Found](/errors/cdn/amplify-404)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
