Deploy & Ops
Vercel Deploy Debugging
Use when a deploy fails but the local build passes, or a deploy succeeds and the deployed site is wrong. Covers a build that is green locally and red in CI, a type error only the deploy sees, a missing or wrongly scoped environment variable, a file that was never committed, a lockfile or package-manager version mismatch, and a stale build cache. If a deploy log needs reading, use this skill.
1 file
Description
Use when a deploy fails but the local build passes, or a deploy succeeds and the deployed site is wrong. Covers a build that is green locally and red in CI, a type error only the deploy sees, a missing or wrongly scoped environment variable, a file that was never committed, a lockfile or package-manager version mismatch, and a stale build cache. If a deploy log needs reading, use this skill.
name: vercel-deploy-debugging description: Use when a Vercel deployment fails but the app builds locally, or when a push to the production branch does not produce the expected running revision. Covers pnpm install gates, type gates, env vars, and commit hygiene.
Vercel Deploy Debugging
When to trigger
A red deploy on Vercel, a build that works with pnpm build locally but fails in CI, or production serving an older commit than you pushed.
Diagnosis order
-
Read the build log top to bottom. The first error is the real one; later errors are usually cascades.
-
Reproduce CI conditions locally:
CI=1 pnpm install --frozen-lockfile. This surfaces lockfile drift and blocked dependency build scripts that a normalpnpm installhides. -
Reproduce the type gate exactly as the deploy runs it. If the project gates on
tsc --noEmitor the native preview, run that same command, not justnext build. -
Verify the committed tree, not the working tree. Agents leave unstaged files; a commit that imports an unstaged module passes locally and fails CI. Check with a temp worktree of HEAD:
git worktree add /tmp/verify HEAD && cd /tmp/verify && pnpm install && pnpm build
Common causes
- pnpm 11 blocks dependency build scripts by default and hard-fails with
ERR_PNPM_IGNORED_BUILDS. The approval list isallowBuilds:inpnpm-workspace.yaml. The pnpm 10onlyBuiltDependenciesand pnpm 9package.json#pnpmkeys are silently ignored by pnpm 11. - A missing env var that exists in
.env.localbut was never added to the Vercel project. Server code that reads it at build time fails the build; code that reads it at request time fails at runtime. - Two concurrent builds racing on
.nextproduce ENOENT on build manifest temp files. Never run two builds in the same checkout at once.
Pitfalls
next buildsucceeding does not mean the type gate passes. If the deploy runs a separate typecheck, an untyped file can still break it.- Production can keep serving the last good deploy after a failed one. A green URL is not proof your commit shipped. Verify the served commit hash against
git rev-parse origin/main.
Added 2026-07-01. Back to the Skill Library.

Get Smarter About AI Dev
New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.