Fix guides · Lovable, Supabase, Vite ·
Fix Lovable app not loading / 'Something went wrong'
Something went wrong on our end. You can try refreshing or head back home.
A Lovable-built app shows 'Something went wrong' or a blank page after publishing. Lovable hosts the app on its own infrastructure; GitHub sync only mirrors code. The error is usually a runtime JavaScript error visible in the browser console, or a Supabase configuration mismatch in Lovable's Supabase integration.
Common causes – and how to tell which one you have
1. Supabase integration mismatch in Lovable
How to tell: Console shows Supabase errors: invalid URL, wrong key, or missing table. Lovable's Supabase integration may point at a different project than the one your app expects.
Fix: Use Lovable's Supabase integration to confirm the correct Supabase project is connected. The integration manages the project connection; do not enter URL or key manually.
2. Browser-visible variable missing from Lovable project environment
How to tell: Console shows undefined variable in the browser. Vite decides which variables reach the browser via the VITE_ prefix — variables without it stay undefined even after being added.
Fix: Add the variable in Lovable's environment variable configuration so it is included in the Vite build. For the exact path, see Lovable's documentation on environment variables. Variables only reach the browser when their name starts with VITE_ — variables without it stay undefined even after being added. Do not add secret keys such as service_role to browser-visible variables.
3. Runtime JavaScript error
How to tell: Browser console shows a JavaScript error or failed network request unrelated to Supabase.
Fix: Capture the exact console error and paste it into Lovable's chat for a targeted fix. Trigger a fresh publish from Lovable after the fix.
How to fix it
- Open browser DevTools -> Console and Network tabs, refresh the page, and capture the exact error message — a runtime JavaScript error, a failed Supabase request, or a missing variable each point to a different cause.
- If the console shows Supabase errors (invalid URL, wrong key, missing table), use Lovable's Supabase integration to confirm the correct Supabase project is connected. The integration manages the project connection; do not enter URL or key manually.
- If the console shows undefined variables, add the variable in Lovable's environment variable configuration. For the exact path, see Lovable's documentation on environment variables so the variable reaches the Vite build. Never add secret keys such as service_role to browser-visible variables.
- In Lovable, publish the app again after the fix, then reload the page and check the console.
- If the error persists, paste the exact console error into Lovable's chat and ask it to fix that specific error.
Using Lovable, Bolt or v0?
In Lovable: 'My app shows Something went wrong'. Check browser DevTools Console first for the exact error. If Supabase-related, use Lovable's Supabase integration to confirm the connected Supabase project is correct. If undefined variables, add the variable in Lovable's project settings so it is included in the Vite build (VITE_ prefix only, no secrets). Publish the app again after the fix, then reload and check the console.
Using Cursor, Claude Code or Windsurf?
Ask Cursor or Claude Code to first capture the browser console error when the page fails to load. Then use Lovable's Supabase integration to confirm the correct Supabase project is connected, and add any missing browser variables in Lovable's project settings (VITE_ prefix only, no secrets). Publish the app again from Lovable and confirm the error is gone.
The “fix” to avoid
Repeatedly republishing without checking the console error — republishing identical broken config won't help. Assuming a separate GitHub-hosted deployment — Lovable hosts the app; GitHub sync only mirrors code. Adding secret keys such as service_role to browser-visible variables — they will be exposed to every visitor.
Copy-paste fix prompt for your AI coding tool
Paste this into Cursor, Claude Code, Lovable or Bolt:
My Lovable-built app shows 'Something went wrong' or a blank page. First check if the app works in the Lovable preview. Open browser DevTools -> Console and capture the exact error message. If it is a Supabase error (invalid URL, wrong key, missing table), use Lovable's Supabase integration to confirm the correct Supabase project is connected. If it is an undefined variable error, add the variable in Lovable's environment variable configuration so it is included in the Vite build (VITE_ prefix required; variables without it stay undefined). For the exact configuration path, see Lovable's documentation on environment variables. In Lovable, publish the app again after the fix, then reload and check the console. Do not republish without first diagnosing the console error.
Questions people ask
Does republishing fix it?
Only if the issue was a transient build failure. A fresh publish with identical broken config or env vars will still fail — check the console error first.
What variables does Lovable expose to the browser?
Vite-based Lovable apps expose variables to the browser only when their name starts with VITE_. Supabase connection variables are managed by Lovable's Supabase integration. Add custom browser variables via Lovable's environment variable configuration (see Lovable's docs). Never add secret keys such as service_role — they will be exposed to every visitor.