---
name: vercel-failed-deploy
description: Find out why a Vercel deployment failed by reading its build events, pinpointing the first real error, comparing with the last good deploy and proposing the fix in code or settings. Use when the user says a Vercel build or deploy failed, errored or is stuck, or shares a failed deployment link.
---

# Fix a failed Vercel deploy

## Steps

1. Find the deployment: the one the user linked, or the latest with state ERROR from `list_deployments` for the project.
2. Read the build log with `get_deployment_events`. Find the first real error, not the final "Command exited with 1". Common ones:
   - a missing environment variable at build time;
   - a TypeScript or lint error that fails `next build`;
   - a module not found, from a case-sensitive import or a dependency missing from package.json;
   - a Node.js version mismatch;
   - the output directory not found, from a wrong framework preset or root directory;
   - an out-of-memory or build timeout.
3. Compare with the last READY deployment of the same target from `list_deployments`, using `get_deployment` for its commit. What changed between the two commits is usually the cause.
4. Check project settings with `get_project`: framework, root directory, build command and Node.js version.
5. Use `search_vercel_documentation` for platform-specific errors.

## Report

The error line quoted, the cause, and the fix: a code change when the repo is open, or the exact setting to change in the dashboard. Then say how to redeploy, by pushing a commit or using Redeploy in the dashboard.
