afterbuild/ops
§ FIX/DEPLOY/deploy fixes

Deploy fixes for AI-built apps

The works-locally-breaks-in-production class of failure is where AI-built apps spend the most post-deploy hours. Lovable, Bolt, v0, Cursor, and Claude Code each ship apps whose localhost path is smooth and whose production path is not — env vars set only in Development scope, edge runtime directives added silently, case-sensitive imports that pass on macOS and fail on Linux, Tailwind content globs that miss the /app directory, hydration mismatches from Date.now() on the server. Per the 2025 Stack Overflow Developer Survey, 66% of developers say AI tools increase deploy frequency — and post-deploy incident rate is up commensurately. This hub groups every deploy-time fix on the site into one navigable index.

By Hyder ShahFounder · Afterbuild LabsLast updated 2026-04-18

9
Indexed deploy fixes
95%
Map to 5 root causes
Env · runtime · imports · hydration · Tailwind
20m
Typical 500 diagnosis
100%
Root-cause fix
+ regression test
§ 01/scope

What this hub covers

This hub covers any failure that appears at or after deploy to Vercel and is not specific to auth, payments, or the database layer. Vercel 500 errors, white screens, build failures with empty logs, env-var scoping, hydration mismatches in production, edge runtime incompatibilities, missing Tailwind styles, broken next/image, and CORS errors that only show up on the production domain. The primary surface is Next.js App Router 16 on Vercel, but most failure modes apply to any Node-runtime deploy.

What this hub does notcover: Stripe webhook failures that happen to surface after deploy (see the payments hub), OAuth redirect URI misconfigurations (auth hub), or Supabase RLS drift (database hub). The boundary is: if the same failure would happen on a staging domain with correct config, it belongs here; if the failure is specific to a third-party integration, it belongs in that category's hub.

§ 02/common failures

The most common failures

Six deploy-category failure modes appear in every rescue intake for AI-built apps. Each is a predictable consequence of the gap between the generator's localhost assumptions and Vercel's production environment.

§ 03/indexed fixes

Indexed deploy fixes

Each link is a root-cause walkthrough: exact error string, the commit shape that produced it, the fix, and the regression test.

§ 04/shared root causes

Shared root causes

Deploy-category symptoms differ, but their root causes cluster into four patterns. Rule each out before diving into the stack trace.

§ 05/prevention checklist

Prevention checklist

Merge these before the next production deploy. Each one replaces a silent production failure with a loud build failure.

  1. Validate process.env at module load with a zod schema. A missing required var should fail the build, not the first production request.
  2. Set every env var in Vercel → Settings → Environment Variables in all three scopes (Development, Preview, Production) unless there is a specific reason to differ.
  3. Remove every export const runtime = "edge" directive unless the route has been verified to use only edge-compatible APIs.
  4. Lock Node version in package.json"engines" and match Vercel's project setting.
  5. Run a case-sensitive filesystem check in CI (git config core.ignorecase false locally; eslint plugin import/no-unresolved).
  6. Write every browser-only global access inside a useEffect or a component guarded by "use client" with a typeof window check.
  7. Audit tailwind.config.ts content paths and add dynamic class strings to the safelist or rewrite them as full literal names.
  8. Add every remote image host to next.config.js images.remotePatterns before first use.
  9. Add a smoke test that hits /, /api/health, and one auth-protected route on every preview deploy.
  10. Review the Vercel function log after every deploy for 5 minutes; a caught early 500 is a 20-minute fix, an uncaught one is a support ticket.
§ 06/escalation signals

When to bring in a developer

Most deploy fixes are 20-minute patches once the root cause is identified from the function log. Bring in a developer when: the build fails with no log output and no reproduction on the local machine, the deploy succeeds but the site intermittently returns 500 under no observable pattern, a revert to a known-good commit also fails, or the build is reaching memory or time limits on Vercel's infrastructure.

Escalate immediately if the site has been broken for more than six hours and the founder is burning credit or losing signups. Book the Emergency Triage for a single deploy-blocking incident, or the Break the Fix Loop service if the app has been in a cycle of revert-and-redeploy for more than 48 hours.

§ 07/related clusters

Related clusters

For the stack-wide walkthrough of Vercel deploy failures, read the Vercel deploy fix stack hub. For platform-specific deploy failures, see the per-builder problem pages: Lovable preview works, prod broken, Bolt deployment failing, Bolt preview works, prod broken, Cursor deploy failing, Cursor local works, prod broken, v0 deploy to Vercel, and Replit deployment not sticking. When the deploy symptom chains into another category, continue at the payment fix hub, the auth fix hub, or the database fix hub.

Next step

Production down right now?

Book the 48-hour emergency triage for one deploy-blocking fix, fixed price, refund if we miss. Or the free diagnostic for a written rescue-vs-rewrite recommendation.