Backstop App broke? Get it fixed →
Bolt · Deploys · Production

Bolt app broke in production? A calm, step-by-step recovery.

It worked perfectly in the Bolt preview, then went live and broke — a blank page, a failed build, or features that just don't respond. Here's an ordered checklist to find which of the usual causes is breaking your live site, and the exact fix for each.

Updated June 2026 · ~8 min read

TL;DR

If it works in preview but not live, your production environment variables are missing or unprefixed (#2) — the #1 cause. A blank white screen is a runtime error or SPA-routing 404 (#3). A failed build on the host is usually a Node version or case-sensitive import (#4). Broken features are API/CORS/key issues (#5) or Supabase config (#7). If an AI edit caused it, roll back to the last working deploy first (#6), then diagnose calmly.

First, triage: find out which kind of broken it is

Don't change code yet. Spend two minutes deciding which of three failures you have — the fix is completely different for each.

Why this matters: "It's broken" has at least three root causes that look similar to a customer but have nothing in common under the hood. The deploy log tells you build-vs-runtime in seconds; the browser console tells you runtime-vs-network. Read those two things before touching anything.

1. Open the deploy log and the browser console

Your host keeps a log of every deploy. On Netlify it's Deploys → the latest deploy → Deploy log; on Vercel it's the deployment → Building / Runtime Logs. A failed build ends with a clear error and a non-zero exit code. A green "Published" with a broken site means the problem is in the browser, not the build.

On the live site, the browser console is the single most useful tool you have. A red message like Uncaught ReferenceError, undefined is not a function, or Failed to fetch usually names the exact file or call that broke. Copy that message — it's the search term that solves most of these.

2. Missing environment variables in production (the #1 cause)

This is, by a wide margin, the most common "works in preview, broken live" report. Bolt's preview and your local machine have your environment variables; your deployment host does not unless you set them there too. So a key that's present in preview is simply undefined in production, and any code that depends on it fails.

Fix: Add every variable your app needs to the host's environment settings — Netlify: Site settings → Environment variables; Vercel: Settings → Environment Variables. Then trigger a fresh deploy: env vars are read at build time, so a site built before you added them won't see them.

There's a second trap that bites almost everyone. In a Vite app (which most Bolt projects are), only variables prefixed VITE_ are exposed to browser code. Anything without that prefix stays server-only and reads as undefined in the front-end. Frameworks have their own prefix — NEXT_PUBLIC_ for Next.js, PUBLIC_ for SvelteKit/Astro.

# A browser-visible value MUST be prefixed:
VITE_SUPABASE_URL=https://yourproject.supabase.co
VITE_SUPABASE_ANON_KEY=eyJhbGciOi...   # anon key is safe in the browser

# This will be undefined in front-end code (no VITE_ prefix):
SUPABASE_URL=https://yourproject.supabase.co
Never commit or paste a secret key into client code. Only publishable/anon keys (designed to be public) belong in VITE_ / browser-exposed variables. A real secret — a service-role key, a Stripe sk_ key, an API secret — must live only in a server-side environment variable, never in the repo and never in a chat prompt. If one has leaked, rotate it immediately.

3. Blank white screen, or the page loads then nothing

A blank page after a successful deploy almost always comes down to one of three things — and the console tells you which.

Fix for the SPA refresh 404 — add a fallback redirect so every route serves your app's entry file. On Netlify, create public/_redirects (it gets copied to the build output):

/*    /index.html   200

On Vercel or Cloudflare Pages a SPA is usually detected automatically, but if not, add a rewrite of all paths to /index.html. After adding it, re-deploy and test by loading a deep link directly and hitting refresh.

4. It builds locally but fails on the host

The build runs clean on your machine, then dies on the host. The host's build server is a different, stricter, case-sensitive Linux environment — and that difference surfaces bugs your laptop hides. Read the host's build log; the failing line is usually explicit. The four usual culprits:

Reproduce it before you guess: run a clean production build locally — delete node_modules, run npm ci then npm run build. That mimics the host far better than your day-to-day dev server and surfaces most of these without burning deploy minutes.

Live site down and you don't have hours to debug it?

Send me what's happening and I'll get your Bolt app back up — flat fee, quoted up front, reply the same day. Most production rescues are sorted within a day or two.

Get my app fixed → Flat fee · reply today · no retainer required

5. API calls fail in production

The page loads but a feature is dead — data won't load, a save fails, login spins. Open the Network tab, trigger it, and read the failed request. A handful of causes account for nearly all of these:

6. An AI edit broke the build — roll back first, diagnose after

If everything was fine an hour ago and a Bolt edit broke it, do not start frantically editing live. The calm emergency move is to get the site working again by rolling back to the last good deploy, then diagnose with the pressure off.

The principle: separate "make it work now" from "understand why it broke." Rolling back does the first in 30 seconds so you can do the second without a clock running.

7. Supabase / back-end connection issues

If your app uses Supabase and the page renders but is empty — no data, lists that never populate — the front-end is fine and the database connection or permissions are the problem. Two causes dominate:

How to stop it breaking again

Production breaks on AI-built apps are uniquely nasty because they're silent: the deploy says "Published," everything looks fine to you, and the first you hear of it is a user (or no user at all, just a quiet drop in signups). Two habits prevent most of the pain:

That's exactly what Backstop does — it runs your real critical flows as live browser tests around the clock, watches your back-end, and alerts you in plain English the moment one breaks, so you hear it from us before you hear it from a customer.

Catch the next break before your users do.

Join the waitlist for Backstop — monitoring + offsite backup built for apps made on Bolt, Lovable, Replit and Supabase. We'll email you at launch, nothing else.

Frequently asked

It works in Bolt preview but breaks on my live site — why?

The number one cause is missing environment variables. Keys you set in Bolt or locally aren't automatically set on your deployment host — add them there and re-deploy. And remember client-side values need a VITE_ (or NEXT_PUBLIC_ / PUBLIC_) prefix to be visible to browser code, or they read as undefined (#2).

My deployed Bolt app is a blank white screen.

Usually a runtime JavaScript error or client-side routing that 404s on refresh. Open the browser console on the live site and read the red error. If only deep links or refreshes fail, add an SPA fallback redirect (/* /index.html 200 on Netlify) so every path serves index.html (#3).

It builds locally but fails on the host.

Read the host's build log for the exact failing line. The usual causes are a Node version mismatch, case-sensitive import paths that work on Mac/Windows but fail on the host's Linux build, a dependency missing from package.json, or a lockfile out of sync. A clean local npm ci && npm run build reproduces most of them (#4).