Skip to main content
Watch: Claude Code Just Killed After Effects

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.

verceldeploynextjscipnpm

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.

Install
SKILL.md

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

  1. Read the build log top to bottom. The first error is the real one; later errors are usually cascades.

  2. Reproduce CI conditions locally: CI=1 pnpm install --frozen-lockfile. This surfaces lockfile drift and blocked dependency build scripts that a normal pnpm install hides.

  3. Reproduce the type gate exactly as the deploy runs it. If the project gates on tsc --noEmit or the native preview, run that same command, not just next build.

  4. 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 is allowBuilds: in pnpm-workspace.yaml. The pnpm 10 onlyBuiltDependencies and pnpm 9 package.json#pnpm keys are silently ignored by pnpm 11.
  • A missing env var that exists in .env.local but 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 .next produce ENOENT on build manifest temp files. Never run two builds in the same checkout at once.

Pitfalls

  • next build succeeding 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.

AI Development Stack

Get Smarter About AI Dev

New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.

One email per weekReal code, not theoryFree forever