Lovable app shows a blank page after publish: how to fix it
Your Lovable app works in preview but is a white screen when published or deployed to Vercel/Netlify. Here is why and the step-by-step fix.
This is one of the most common complaints in r/lovable: preview looks perfect, you hit publish (or deploy the GitHub repo to Vercel), and you get a white screen with no error. In almost every case the live build is missing something the preview had: usually your Supabase URL and key.
Why it happens
Lovable apps are Vite + React. Vite only exposes variables that start with VITE_ to the browser, and it bakes them in at build time. If those variables were not set in your host before the build ran, the bundle contains undefined, createClient() throws "supabaseUrl is required", and React never renders.
Step 1: confirm it in the browser console
Open the live site, press F12 → Console. Typical errors:
Uncaught Error: supabaseUrl is required.
GET https://yourapp.vercel.app/dashboard 404 (Not Found)
Failed to load resource: net::ERR_NAME_NOT_RESOLVEDStep 2: copy the exact variable names from your project
Open the .env file in Lovable or your synced GitHub repo. Names differ per project (older projects use VITE_SUPABASE_ANON_KEY, newer ones VITE_SUPABASE_PUBLISHABLE_KEY). Copy them verbatim:
VITE_SUPABASE_URL=https://abcd1234.supabase.co
VITE_SUPABASE_PUBLISHABLE_KEY=eyJhbGciOi...Step 3: add them in your host and redeploy
Vercel: Project → Settings → Environment Variables → add each one for Production (and Preview). Then Deployments → ⋯ → Redeploy. Setting the variables without redeploying changes nothing, because they are baked in at build time.
Step 4: fix 404s on refresh (single-page app rewrites)
If the home page works but /dashboard returns 404 on refresh, add a vercel.json at the repo root:
{
"rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
}Step 5: pin your Node version
Commit a .nvmrc file containing 20 so the host builds with the same Node version every time.
Still blank?
Check the Network tab for failed Supabase calls (CORS or a paused Supabase project), and confirm the build output directory is dist.
Rather have it fixed for you?
We take your Lovable or Bolt app live on Vercel with your domain and working login, for $39 flat. Full refund if it fails.
Get it live – $39 Security scan – $19