Home / Fixes / Blank production page

Localhost is fine. The production URL is blank.

This is almost never the host breaking React. It is a build-time environment variable that was on your laptop and not in the project settings.

Symptoms

The deployed host shows a blank page. The same commit is healthy on a local dev server. The browser console mentions a missing project URL. The build log is green.

Why AI-built apps hit this

Lovable and Bolt read public env via Vite and keep the values in a local env file. Vite substitutes those values when it builds, not when the browser runs. The host build machine does not have your laptop file unless you pasted the vars in Settings. Missing values become empty inside the bundle. The first client init fails.

v0 and Next have the same shape with the NEXT_PUBLIC_ prefix. Server-only vars can wait until the function runs; public vars cannot.

The actual fix

1. Open the production URL with DevTools, Console. Read the first red line. Search that string in your source; it will sit next to a public env read.

2. Project settings, Environment Variables. Add every public var the app reads, names copied exactly, including the prefix.

3. Redeploy. Env changes do not patch an old build.

4. Confirm Production vs Preview. A var set only on Development never reaches the production build.

5. After deploy, the built JS should contain your project host. If it is still empty, the name still does not match.

Do not fix a blank page by putting a service role or Stripe secret in a public prefixed var. That will create a client, and it will also publish the admin key. See the public vs secret page.

Other blank pages worth ruling out

A client-side router with no fallback, so a refresh on an inner path returns 404. For a Vite SPA, add a host fallback that serves the app shell for unknown paths. Also: the API still on http while the site is HTTPS. Also: an exception in an effect that local StrictMode happens to survive. Open the console on production; do not guess.

If the console is empty and the page is blank, view the HTML. A 404 document or a login wall from the host is not this bug.

$49 to run this against your tree

Zip or GitHub URL in. Ranked HTML/PDF in 24h. No call. First 10 audits are $49, credited if you continue to triage. Email contact@shipready.local.

Start an audit See a sample report