Mendlark / Guides
Supabase returns empty data after deploy (no error): how to fix it
Your Lovable or Bolt app loads, nothing crashes, but lists are empty. The table has rows in the Supabase dashboard, yet the app gets back []. No red error anywhere. This is almost always Row Level Security (RLS) doing its job with no policy that lets your user through. Here's how to confirm it and fix it safely.
Stuck on this? Get it fixed for €49.
Fixed in 48 hours or you don't pay. Launch deal for the first 5 customers (normally €79). You get the tested fix as a pull request, so nothing changes until you merge it.
Get it fixed for €491. Why there's no error
When RLS is on and no policy matches, Supabase doesn't refuse the query. It quietly filters out every row the user isn't allowed to see. A select returns an empty array, and an update or delete "succeeds" while changing nothing. So the app looks fine but shows nothing.
(If you see error 42501 permission denied for table instead, that's a different problem, missing grants: see the 42501 guide.)
2. Confirm it in two minutes
- In Supabase, open Table Editor, pick the table and check whether RLS is shown as enabled.
- Open Authentication → Policies. If the table has RLS enabled and no policies, nobody using the anon or logged-in key can read it.
- In your app, open the browser Network tab, find the request to
/rest/v1/your_tableand check the response. A200with[]means RLS filtered it.
Note that the SQL Editor in the dashboard runs as an admin role and ignores RLS, so "it works in the SQL Editor" doesn't prove the app can see the data.
3. Don't fix it by turning RLS off
The AI's usual suggestion is to disable RLS. That makes the data appear, but it also means anyone with your public anon key (which is in your site's JavaScript) can read and often change every row. Add a policy instead.
4. Add the policy you actually need
For a table where each row belongs to a user, with a user_id column holding their auth ID:
create policy "Users read own rows"
on public.projects for select
to authenticated
using ( (select auth.uid()) = user_id );
create policy "Users insert own rows"
on public.projects for insert
to authenticated
with check ( (select auth.uid()) = user_id );
Add matching update and delete policies if the app needs them. For genuinely public data (like a list of published blog posts), a read-only policy for everyone is fine:
create policy "Anyone can read published posts"
on public.posts for select
to anon, authenticated
using ( published = true );
5. Check the rows actually have a user_id
A common catch: rows created during testing, or inserted without setting user_id, have it empty. The policy compares auth.uid() to null, which never matches, so those rows stay hidden. Make sure inserts set user_id (or give the column a default of auth.uid()), and fix old rows.
6. Check the user is really logged in
Policies for authenticated only apply if the request carries the user's session. If login is broken on the live site (for example, a redirect back to localhost), every request runs as anon and gets nothing. See the Supabase auth redirect loop guide.
7. Test as a second user
Once data appears, open an incognito window, sign up as a different user and make sure you can't see the first user's rows. That's the test that tells you the policy is right, not just permissive.
Quick checklist
- Empty
[]with no error = RLS with no matching policy - Keep RLS on; add select/insert/update/delete policies as needed
- Rows have
user_idset - The live site sends a logged-in session
- Second-user test in incognito passes
Stuck on this? Get it fixed for €49.
Fixed in 48 hours or you don't pay. Launch deal for the first 5 customers (normally €79). You get the tested fix as a pull request, so nothing changes until you merge it.
Get it fixed for €49Still stuck?
Mendlark fixes this kind of problem for a fixed price: €49 for the first 5 builders (normally €79). We agree the problem first, test the fix and send it as a pull request. Fixed in 48 hours or you don't pay. Fix it for €49 or start with a free scan.
Not sure what else is wrong? Paste your app link into the free instant check and get a plain-English list of problems in seconds.