Symptom: empty Supabase data
Supabase returns empty data in Lovable (and no error)
The rows are right there in the Supabase table editor. But your Lovable app shows nothing, the query returns [], and there’s no error to go on. This is one of the most common walls vibe coders hit.
Why this happens
Supabase uses Row Level Security (RLS), database rules that decide which rows each user can see. When RLS is on and no rule lets the current user read a row, Supabase doesn’t throw an error. It just returns nothing. The table editor shows everything because it runs with admin access, which is why it looks like the data “exists but won’t load.”
- RLS is on but there’s no SELECT policy. Writes may work while reads come back empty.
- The policy checks the logged-in user, but the request isn’t logged in. A rule like
auth.uid() = user_idreturns nothing if the query runs before the session loads, or from a page where the user isn’t signed in. - The rows don’t match the policy. Rows inserted without a
user_id, or with a different one, are invisible to that user.
The tempting “fix” is turning RLS off or adding a policy that lets anyone read everything. That makes the data appear, and it also exposes it to anyone with your public key. Don’t let the AI do that.
The fix: diagnose the policy, then change one thing
Paste this into Lovable’s chat (or Cursor, Bolt, Claude Code), filling in the brackets:
My Supabase query on the [table name] table returns an empty array with no error, but the rows exist in the table editor. Do not disable RLS and do not add a policy that allows everyone to read all rows. 1. Show me the current RLS status and every policy on [table name], in plain English. 2. Show me the exact query the app runs and whether the user is signed in (and what auth.uid() is) when it runs. 3. Check whether the rows I expect have a [user_id / owner column] that matches that user. 4. Tell me which of these is the cause: no SELECT policy, no session at query time, or rows that don't match. 5. Propose ONE minimal fix that only lets the signed-in user read their own rows. Show the SQL before running it.
Why it works: it rules out the three real causes in order and blocks the insecure shortcut that AI tools often reach for first.
Quick checks before you paste it
- In Supabase, open the table’s policies and confirm there’s at least one policy for SELECT.
- Make sure you’re signed in to your app when you test, in the same browser.
- Look at one of the rows you expect to see and check its owner column isn’t empty.
Stop the next loop before it starts
The free 2-Strike Rule card tells you exactly when to stop retrying and what to paste instead. One page, keep it next to your editor.
Free via Gumroad: enter $0 and your email at checkout.
Related symptoms
Seeing “new row violates row-level security policy” or an endless login redirect instead? The Loop Breaker Pack has a full Supabase and auth section with prompts for each.