Vibe Code Rescue

Lovable app shows a blank white screen? The usual cause and the fix

Your app works inside Lovable. Then you deploy it somewhere else, or a collaborator clones it, and all anyone gets is a pure white page. The build passed with zero errors. Nothing in any log explains it. This is the single most common failure I see in Lovable and Bolt apps, and it almost always has the same cause.

The symptom

The cause: your app crashes before React starts

Lovable apps typically use Supabase, and the generated code usually contains a file like src/lib/supabase.ts or src/integrations/supabase/client.ts that reads two environment variables:

const supabaseUrl = import.meta.env.VITE_SUPABASE_URL;
const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY;

if (!supabaseUrl || !supabaseAnonKey) {
  throw new Error("supabaseUrl is required.");
}

Inside Lovable those variables are always injected, so this code never fails where the app was written. But Vite happily builds with the variables missing, it just inlines undefined. When someone opens the built app without them, the throw fires while the JavaScript bundle is still loading, before React mounts anything. Even if the app has an error boundary, it does not exist yet, so nothing can catch the crash. The page stays white.

Most generated repos also ship no .env.example and no setup docs, so every fresh clone and every new deployment hits this wall with no clue why.

Confirm it in 30 seconds

Open the blank page in Chrome, press F12 to open DevTools, and look at the Console tab. If this is your problem you will see a red uncaught error mentioning supabaseUrl is required, Missing Supabase, or similar, thrown from a file with supabase in the name.

The quick fix

Set the two environment variables wherever the app runs:

The real fix

The quick fix gets you unblocked, but the app is still a landmine for the next person who clones or deploys it. The durable fix is to stop crashing at import time:

I made exactly this fix to a real Lovable campus delivery app that white-screened on every fresh clone: 3 files, 34 lines. Verified in a headless browser: before the fix the page rendered 0 characters; after it, an unconfigured clone renders a setup screen and a configured one renders the full app, pixel-identical to the production site. The change is public: see the pull request.

Still white after setting the variables?

Then you are probably in a different failure class: a routing basename mismatch, a crashed top-level component, or a build that silently outputs to the wrong directory. Those need the console error and the repo to diagnose.

Run the instant diagnosis. Paste your public repo URL into the form and an automated clean-room check installs, builds, and renders your app, then posts a plain English report naming the exact blocker, in minutes, free. This white screen failure class is precisely what it catches. Private repo or zip? Email works too.

Get an instant free diagnosis

Or email me instead. Fixes with 24 hour turnaround start at $95. Prefer self-serve? The $5 instant diagnosis on Apify checks your repo privately, no public issue needed.