# "supabaseUrl is required." and a blank white page after deploying your Lovable or Bolt app

- Fix ID: APP-01
- Exact error: `Uncaught Error: supabaseUrl is required.`
- Status: Manually verified (CI: pending, no CI results exist yet)
- Last verified: 2026-10-26
- Platforms: Supabase, Lovable, Bolt, Cursor, Vercel, Netlify
- Versions: os=Debian 13 (container); node=20.19.2; vite=8.3.5; react=19.3.1; @supabase/supabase-js=2.109.0; browser=Headless Chrome 156
- Repro: https://stucktoshipped.com/repros/APP-01/ (file hashes only; files are in the paid repro bundle)
- Canonical: https://stucktoshipped.com/fixes/supabase/supabaseurl-is-required-blank-page/

## In brief
The Supabase settings never made it into your production build. The full fix shows the exact variable names to set on Vercel or Netlify, the two traps we confirmed, and how to verify the live site.

## Symptom
You built a Vite + React app with Supabase in Lovable, Bolt or Cursor. It works in the builder's preview. Then you deploy it to Vercel or Netlify, and the live URL shows a **blank white page**. The browser console (F12, then Console) shows:

```
Uncaught Error: supabaseUrl is required.
```

## Why it happens
- **Your `.env` file never reaches the host.** The Supabase URL and key live in `.env`, which is normally not uploaded.
- **The values get baked in at build time.** Vite copies `VITE_` variables into your JavaScript when it builds. If they are missing at that moment, the Supabase client gets `undefined` and crashes before React draws anything.
- **The deploy still looks "successful",** because the HTML loads fine and only the JavaScript crashes.

Two traps we confirmed:
1. **Wrong name.** A variable named `SUPABASE_URL` without the `VITE_` prefix is ignored. The page stays blank.
2. **No rebuild.** Adding the variables without a new build changes nothing.

## What we could not test
- The real Vercel and Netlify dashboards and their Production vs Preview scopes.
- Talking to a real Supabase project, including "Invalid API key" from mismatched projects.
- Lovable's own hosting (Lovable's terms bar automated tools without written permission, so we did not use it).
- Next.js apps, which use `NEXT_PUBLIC_` instead of `VITE_`. Same idea, not tested.

## Full fix (paid)
The step-by-step fix, commands and test record are paid content and are not in this file. Price: $4 per fix (planned launch price; checkout not open yet). SHA-256 of the full fix: 6ad2dfb2e96ae9329ee9ebfb919f60175d88ba5b7a4c4a612dc702dd0655c3a9. How to buy: https://stucktoshipped.com/pricing/ and https://stucktoshipped.com/products.json

## Sources
- [Stack Overflow: Error: supabaseUrl is required](https://stackoverflow.com/questions/68239168/error-supabaseurl-is-required-supabase-postgresql)
- [Stack Overflow: Next.js + Supabase not deploying, supabaseUrl is required](https://stackoverflow.com/questions/74264517/nextjs-supabase-not-deploying-supabaseurl-is-required)
- [Stack Overflow: Vite env variable returns undefined in production with Vercel](https://stackoverflow.com/questions/75559927/vite-env-variable-returns-undefined-in-production-with-vercel)
- [r/lovable: connecting a Lovable site to Netlify](https://www.reddit.com/r/lovable/comments/1w5880y/i_need_help_with_connecting_my_lovable_site_to/)
- [Netlify Knowledge Base: deploy your Lovable app](https://www.netlify.com/knowledge-base/deploy-your-lovable-app-to-netlify/)
- [Lovable docs: external deployment and hosting](https://docs.lovable.dev/tips-tricks/external-deployment-hosting)

## How this page was made
Drafted by an AI agent and reproduced on our test machine on 2026-10-26. No warranty; test on a copy first.
