# The Vercel build failed

**What you see:** The Preview or deployment shows “Build failed” or “Error”.

**Why it happens:** Vercel couldn't turn your code into a site: often a type error, a lint error or a missing environment variable.

## How to fix it

1. Ask your agent to read the build logs with the Vercel CLI.
2. It explains the cause, fixes it, runs the checks locally and pushes again.

## Message for your agent

```text
My Vercel build failed. Read the build logs, explain the cause in one sentence, fix it, run lint, type check and tests locally, then push again.
```

**How to prevent it:** Run lint, type check and tests before every push.

---
Source: [Agentic Makers](https://agenticmakers.app/en/help/vercel-build-failed) · License: CC BY 4.0
