This guide is about apps built with Lovable (lovable.dev), the AI app builder that generates React apps with a Supabase or Lovable Cloud backend. It isn’t about dating apps or anything else called “Lovable”.
Lovable is good at getting a working app in front of you quickly. Problems usually appear later: once real users sign in, once you publish, or after the tenth “fix it” prompt. Below are nine common failures. For each one you get how to confirm it and how to fix it. If you’d rather have someone look at it directly, see how we fix Lovable apps.
Before you start, open your app in a normal browser tab and open DevTools (F12 or Cmd+Option+I). Most of these checks need the Console and Network tabs.
1. Blank white screen: the app won’t load at all
What you see: the published URL or the preview shows a white page with no error.
Why: a React app that throws during its first render shows nothing at all. Common triggers are a missing environment value, an import of a file that was renamed or deleted, or code that reads user.id before the user has loaded.
Check:
- Look in the Console for the first red error, not the last one.
Cannot read properties of undefinedorFailed to fetch dynamically imported moduletells you the file and line. - In the Network tab, look for JavaScript files that return 404.
- If only the editor preview is blank, Lovable’s docs say to click Refresh first, and to hold Shift while clicking it to restart the preview environment. A hard refresh (Cmd+Shift+R / Ctrl+Shift+R) can also help.
Fix: paste the exact console error into Lovable’s chat and say what you expected. Don’t type “it’s broken”. If the blank screen started right after Lovable’s last response, Undo latest edit under that response reverses it. If it started further back, use version history to revert to the last working version, then re-prompt more narrowly. If the console points at undefined user or profile data, the fix is usually a loading guard:
if (loading) return <Spinner />;
if (!user) return <Navigate to="/login" />;
2. Preview works, but the published app doesn’t
What you see: everything works in the editor, but the live lovable.app URL or your custom domain shows old behaviour or breaks.
Why: Lovable’s docs describe the preview as your staging environment and the published site as “a snapshot that only changes when you publish”. Later changes are not pushed live automatically. Also note that preview and published app share the same backend and data, so a database change you make while testing affects your live users too. If a test run already wiped or overwrote real data, stop and read what to do when an AI agent deletes your database before you try anything else.
Check:
- Is there a dot on the Publish button? That means you have unpublished changes.
- Does the publish dialog show Try to fix instead of Publish? Then your latest build failed, and the live site is still the old snapshot.
- Does the dialog’s security line report findings? The Quick scan runs every time you open the publish dialog. Findings don’t block publishing by default, but Lovable’s docs say to resolve critical issues before you make the app available.
- Is a custom domain still being set up? Lovable keeps publishing to the
lovable.appaddress until the domain shows as Live.
Fix: fix the build error, then click Publish → Publish changes. If the live site breaks on a route that works in preview, load that URL directly (not by clicking through the app) and check the Console. Direct loads expose code that assumed some state already existed.
3. Login works in preview but redirects to localhost (or loops) in production
What you see: after sign-up or password reset, the email link opens localhost:3000. Or Google sign-in bounces you back to the login page.
Why: Supabase Auth uses the Site URL as the default redirect, and any redirectTo your code passes must be on the Redirect URLs allow list. Supabase’s docs say to change the Site URL “from http://localhost:3000 to your production URL” and call this setting “critical for email confirmations and password resets”.
Fix (if you use your own Supabase project): in Supabase go to Authentication → URL Configuration:
- Set Site URL to your real domain, e.g.
https://app.example.com. - Add the exact production URLs you redirect to under Redirect URLs. Supabase recommends exact URLs in production. Keep wildcards like
**for local and preview URLs. - If your code calls
signInWithOAuthorsignUpwithredirectTo, make sure that URL is on the list. Then check your email templates: when you useredirectTo, Supabase notes you may need{{ .RedirectTo }}instead of{{ .SiteURL }}. - Full walkthrough: for step-by-step checks of the Site URL, Redirect URLs and
redirectTo, see Supabase auth redirecting to localhost.
If your project runs on Lovable Cloud (the built-in backend): Lovable’s docs say it sets the Site URL to your published lovable.app address when you publish, and adds a custom domain to the redirect URLs when you connect one. A Site URL you set yourself is left alone, so check it if it still points at an old address. If sign-in still fails, ask Lovable in chat to add your domain, or add it yourself under More → Users → Settings → Advanced → Redirect URLs. Using Google sign-in with your own OAuth client? Add the new domain as an authorized redirect URI in Google Cloud Console too.
4. Logged-in users see an empty list, or can’t save
What you see: the data is in the database, but the app shows nothing, or saving fails with new row violates row-level security policy.
Why: Row Level Security (RLS) is working as intended. Supabase’s docs say that once RLS is enabled, “no data is accessible through the API when using a publishable key, until you create policies”. An empty array usually means no policy matches. An error code 42501 “permission denied” can mean the role has no grant on the table at all, and Supabase’s docs say a missing grant raises 42501 before any policy runs, so check grants before touching policies.
Check: in the Supabase SQL editor:
select tablename, policyname, cmd, roles, qual, with_check
from pg_policies
where schemaname = 'public'
order by tablename;
Fix: write one policy per operation, scoped to the row’s owner:
create policy "notes_select_own" on public.notes
for select to authenticated
using ((select auth.uid()) = user_id);
create policy "notes_insert_own" on public.notes
for insert to authenticated
with check ((select auth.uid()) = user_id);
Also make sure your insert code actually sets user_id. A null user_id fails the with check every time.
A list that fills up but ends at exactly 1,000 rows points at the Data API’s row cap, not at RLS; Supabase only returning 1,000 rows shows how to paginate past it.
New tables and grants
Grants and policies are two separate checks. A grant controls whether a role may run an operation on a table in the first place; a policy then limits which rows that operation touches. On existing projects, Supabase’s docs say a new table in public gets every privilege granted to anon, authenticated and service_role automatically. They also say not every project does this, and that Supabase is changing the platform default so these automatic grants are revoked and exposure becomes opt-in.
So if a brand-new table returns 42501 while older tables work, check its grants:
select grantee, privilege_type
from information_schema.role_table_grants
where table_schema = 'public' and table_name = 'notes';
If authenticated is missing, grant only what the app needs, for example grant select, insert, update, delete on table public.notes to authenticated;. Keep RLS enabled and the policies in place. For the full walkthrough, see Supabase “new row violates row-level security policy”, and for reading and writing policies, Supabase RLS policies explained.
5. The opposite: anyone can read your data (the Lovable security issue)
This is the problem that hurts most, because nothing looks broken.
Why: your frontend talks to Supabase directly, using a key that ships in the browser bundle. That’s by design: Supabase says publishable/anon keys are safe to expose, and RLS is what protects the data. If a table has RLS off, or a policy like using (true), anyone who copies the key from your site can read or change that table.
This exact pattern has a CVE on record. CVE-2025-48757 (published 30 May 2025, CVSS 3.1 score 9.3) describes “an insufficient database Row-Level Security policy in Lovable through 2025-04-15” that let unauthenticated attackers read or write arbitrary tables of generated sites. The record is tagged disputed: Lovable’s position is that each customer is responsible for protecting their app’s data. Lovable now has two built-in scans. The Quick scan runs automatically when you open the publish dialog and checks database access rules, dependencies and MCP server exposure. The Deep scan also reviews your application code, but it doesn’t run on its own: start it from the project’s Security view. Use both, but Lovable’s docs say they “do not replace a thorough security review”.
Check (on your own app only): copy the apikey header from any Supabase request in the Network tab, then run, while logged out:
curl "https://YOUR-PROJECT.supabase.co/rest/v1/profiles?select=*&limit=5" \
-H "apikey: YOUR_PUBLIC_KEY"
A private table should return [] or a permission error, never rows. Find tables with RLS off:
select c.relname from pg_class c
join pg_namespace n on n.oid = c.relnamespace
where n.nspname = 'public' and c.relkind = 'r' and not c.relrowsecurity;
Fix: enable RLS (alter table public.x enable row level security;) and add owner-scoped policies as in #4. Then run a Deep scan from the Security view again. Our vibe-coded app security checklist covers every test in more depth.
6. Leaked keys: a secret is sitting in your frontend
Why: anything in browser code is public. Vite, which Lovable apps are built on, documents that variables prefixed with VITE_ “will be exposed in client-side source code after Vite bundling” and “should not contain sensitive information such as API keys”. Lovable’s docs draw the same line: VITE_SUPABASE_URL and VITE_SUPABASE_PUBLISHABLE_KEY are fine in .env. Stripe secret keys, OpenAI keys, Resend keys and Supabase service_role/sb_secret_ keys belong in Secrets (More → Settings → Secrets), which “never reach the browser”.
Check: open your live site, view the main JS file in DevTools → Sources, and search for sk_live_, sk-, sb_secret_ and service_role. If your repo is synced to GitHub:
npm run build && grep -rE "sk_live_|sb_secret_|service_role" dist/
git log -p --all | grep -E "sk_live_|sb_secret_|service_role"
The legacy service_role key is a JWT starting with eyJ, so the plain word may not appear in it. Compare any eyJ... string in your bundle against the keys in your Supabase dashboard.
Fix: move the call that needs the secret into an Edge Function, and put the key in Secrets. Lovable rejects VITE_-prefixed names in Secrets, because those are build-time browser values that belong in .env. For example, a Stripe secret key belongs in Secrets; Stripe not working in a Lovable or Bolt app shows where each Stripe key goes. Then rotate the key at the provider: create a new key, deploy it, and revoke the old one last. Deleting the key from code isn’t enough, because it’s still in old builds and git history.
7. Edge Function fails with a CORS error
What you see: blocked by CORS policy in the Console when the app calls a Supabase Edge Function.
Why: browsers send a preflight OPTIONS request first, and Supabase’s docs say your function has to handle it. A function that crashes before returning headers also shows up as a CORS error, so check the function logs too.
Fix: use Supabase’s withSupabase wrapper, which handles preflight for you, or handle OPTIONS yourself with the corsHeaders exported from npm:@supabase/supabase-js@^2/cors, as in Supabase’s CORS guide. Then check the function’s logs for the real error underneath. On Lovable Cloud those are in the built-in backend Logs, which you can filter to error responses and paste into the chat.
8. Works for you, fails for real users
Typical causes:
- Email confirmation: new users never confirmed, so they can’t log in. On Lovable Cloud, confirmation emails can also stop when the project hits its hourly email Rate limit, under Advanced in the email settings. Lovable’s docs say to set up managed email or a verified custom domain before raising it.
- Policies tested only as the owner: you’re also the admin, so everything works for you.
- Data shape assumptions: code assumes every user has a
profilerow, but only users created after a certain change have one.
Check: make a second test account in a private window and walk through the full flow. Then try loading user A’s record while signed in as user B. It should fail.
9. The endless fix loop: the AI keeps re-fixing it
You prompt “fix the error”, it fixes one thing and breaks another, and the credits keep going. Lovable’s own docs suggest a better sequence than retrying the same prompt:
- Ask it to investigate, not fix. Describe what you see and what you expected, and ask Lovable to walk you through what’s happening.
- Revert and re-prompt. Roll back in version history to just before the problem appeared, then send a clearer, smaller prompt.
- Plan first. Switch to Plan mode, which investigates without touching your code, review the approach, then build step by step. A Plan message costs one credit, plus any research it runs.
If a prompt you sent earlier set things off in the wrong direction, hover over it and choose Edit message, then Revert and resend. The project goes back to the state before that message and runs your rewritten version.
Your account gets 10 free fixes, shared between Try to fix on build errors and fixes from the Security view, across all your workspaces and projects. Each one refreshes 24 hours after it’s used. After that, fixes use credits. Security scans themselves are free.
Write down the exact error, the last working version, and what changed. That record is useful whether you keep going yourself or hand the app over. If you plan to keep working outside Lovable, export your Lovable app to GitHub and run it yourself first, so every change has a git history you can roll back.
When to hand it to an engineer
Lovable can take you a long way. It’s reasonable to bring in a human when:
- You’ve reverted and re-planned and the same error keeps coming back.
- The issue is in data or auth: RLS, roles, payments, webhooks. A wrong-but-working fix there can leak data.
- You found a leaked secret or an open table and need it rotated and locked down without breaking production.
- You need it to work with real users by a date, not after another week of prompts.
- You don’t know whether it’s secure, and “the scan passed” isn’t enough for your users’ data.
A senior engineer can read the generated code and database policies directly, find the root cause, and explain what went wrong so the AI doesn’t reintroduce it.
Comments