Your Lovable App Shows No Data Even Though Supabase Has Records: What Is Actually Broken?
Your Lovable app shows no data but Supabase has records? See the seven real causes, from RLS and session timing to filters, and prove which one is yours.
Your Lovable app shows no data, but Supabase has records. That usually means the data is not missing. It means the app is not allowed to see it, is not signed in yet when it asks, is asking the wrong project, or is filtering the rows away before they reach the screen.
In most cases the fix is not to rebuild the page. It is to prove which of those four situations you are in, then fix that one cause. This guide gives you that proof first, then walks through the seven real causes in the order worth checking them. Technical behaviour below was checked against the Supabase and PostgreSQL documentation on 30 November 2026.
The 2-minute proof: RLS, wrong project, or code filter?
Open the live app, not the editor preview. Log in as a real user. Open DevTools, go to Network, reload, and filter by rest/v1. Click the request for the empty list.

Four signals, four different families of cause. Read the status and body before changing any policy.
| What you see | What it usually means | Check next |
|---|---|---|
Status 200, body [] | A policy or filter removed the rows | Causes 1, 2, 3, 5 |
Status 401 or 403, or 42501 in the body | A grant or auth problem, not silent filtering | Cause 6 |
No request to /rest/v1/<table> at all | The component never ran the query, or it hit a different project | Cause 4 |
| Request host is not your project host | The app points at another Supabase project | Cause 4 |
Also look at the request headers. If the Authorization bearer token is the same as the apikey header, the query ran without a signed-in user, as anon. That points to Cause 3.
This one check saves the most common wasted hour: changing policies when the app was never talking to the project you were inspecting.

Stop at the first cause that matches your evidence, and change one thing per test.
Cause 1: RLS is on, but there is no SELECT policy
Row Level Security, or RLS, is a Postgres feature that filters which rows a query can see. Think of each policy as an extra WHERE clause that Postgres adds to every query. If no policy lets the current user see a row, the row is simply left out.
That is why this failure is silent. Supabase's documentation states that once RLS is enabled, no data is accessible through the API with a publishable key until you create policies. The dashboard still shows the rows because the dashboard uses a privileged database role, not your app user.
Check in Supabase: Authentication → Policies for the table. If RLS is enabled and there is no policy for SELECT, or no policy for ALL, nothing is readable through the API. Inserts can still work while reads return [], because each operation needs its own policy.
The safe fix for "users see their own rows" is one policy per operation, scoped to the signed-in owner:

Allow the owner, name the role, and give UPDATE both a USING and a WITH CHECK clause.
create policy "Users can view their own rows"
on public.projects for select
to authenticated
using ( (select auth.uid()) = user_id );
create policy "Users can create their own rows"
on public.projects for insert
to authenticated
with check ( (select auth.uid()) = user_id );Replace projects and user_id with your table and owner column. If the data is genuinely public, such as a product catalogue, use a narrow SELECT policy for anon on that table only, and keep writes restricted.
If you already know the problem is RLS and want the full policy pattern, see the guide to Supabase RLS fixes for Lovable apps. That post covers policy writing in depth; this post covers diagnosis when you are not yet sure RLS is the cause.
Cause 2: The policy compares the wrong column, or the owner is empty
A correct-looking policy can still return nothing if it compares auth.uid() to the wrong value.
Open the rows in Table Editor and compare the owner column with the user ID under Authentication → Users. Three mismatches cover most cases:
user_idis null. Rows were created by a seed script, by the SQL Editor, by a server function, or by an insert that never set the owner. A correct policy then has nothing it is allowed to return.user_idholds a different ID. For example, the app saves a profile ID while the policy comparesauth.uid(), or the data was created in another project.- The policy compares email, tenant ID, or team ID. That can be correct for shared data, but only if the column actually holds the value the policy expects.
Fix the write path, not just the read path. New rows should set the owner on insert, or the column should default to the signed-in user. Old rows need a careful backfill: only backfill rows you can prove belong to that user. Do not assign all orphan rows to the first user to make the list look full.
Cause 3: The page queries before the session is ready
This is the cause that looks random. The page loads, fetches data on first render, and gets []. You refresh, and the data appears. Or it works for you and not for a new user.
The reason is timing. The page fetched before supabase-js restored the session from storage. That first request went out as anon. An owner policy for authenticated never matches for an anon request, because auth.uid() is null for a request with no signed-in user token.
The fix is to wait for the session before querying private tables. In React, that usually means one of these:
- Call
getSession()first, and only query if a session exists. - Run the fetch from
onAuthStateChangeonce you haveINITIAL_SESSIONorSIGNED_IN. - Show the login screen instead of querying private tables when there is no session.
Also use one Supabase client for the whole app. If one part of the app creates a second client, that client may not share the restored session, and its queries will run as anon even though the user appears signed in elsewhere.
Cause 4: The app points at the wrong project, or an old build
If the Network tab shows no request to your project host, or the host is different from the project you opened in the dashboard, the app is not talking to the database you are inspecting.
Common versions of this:
- Two Supabase projects. A development project and a production project, or a Lovable Cloud backend and your own Supabase project. Rows exist in one, the app reads the other.
- Wrong env vars on the host. After export to Vercel, Netlify, or another host, the new host does not know the Supabase URL and publishable key unless you set them there. Lovable keeps its own values for its own builds; a new host needs them set again.
- Stale build. Vite replaces
import.meta.envvalues when the app is built. Changing env vars without a new build does nothing. The live site is a snapshot from the last publish, so editor changes do not reach it until you publish or redeploy. - Wrong variable names. Lovable React apps typically read
VITE_SUPABASE_URLandVITE_SUPABASE_ANON_KEY, or the newer publishable key name. If the code reads a different name, the client is created with an empty address.
Check the host in the Network tab first. Then check the host settings for production, not just preview. Then rebuild and redeploy. If the live site still shows old behaviour after a fix, confirm the live build actually includes the fix.
For export and hosting handover, see the Lovable external hosting handover checklist. It covers the same class of problem: the code is right, but the deployed copy is not the copy you tested.
Cause 5: A filter in the code matches nothing
Not every empty list is a database problem. Sometimes the query works and the filter removes every row.
Look for these in the page code:
- A status filter such as
.eq('status', 'published')when the rows aredraftor use a different spelling or case. - A user filter that uses the wrong variable, such as a profile ID instead of the auth user ID.
- A date range that excludes the rows, or a search term that is applied even when the search box is empty.
- A
.single()call that expects exactly one row. If RLS or a filter leaves zero rows,.single()fails withPGRST116, which looks like a data error rather than an empty list. - Pagination that starts on the wrong page, or a limit applied after a filter that already removed the rows.
The fastest check is to remove filters one at a time in a test query. If the unfiltered query returns rows in the app, the database and policies are fine. The filter is the bug. Fix the filter and the data model together: agree the exact status values, spelling, and case, and use them in both the write path and the read path.
Cause 6: A grant or view problem, not a policy problem
Postgres runs two checks before a client touches a table. Grants decide whether a role can run an operation at all. Policies decide which rows that operation applies to. You need both.
This matters because the symptoms are different. A missing grant raises a 42501 error before any policy runs. A policy USING clause that filters a row out raises nothing and matches zero rows. If you see 42501, do not keep editing policies. Check the grants for anon and authenticated on that table.
Views add another trap. Views bypass RLS by default because they are usually created with the postgres user. A view over a protected table can hand out every row its policies were meant to withhold. In Postgres 15 and above, make a view obey the underlying tables by setting security_invoker = true. In older versions, protect views by revoking access from anon and authenticated, or by putting them in an unexposed schema.
If your app reads through a view or an RPC function, test that object as the app user, not just the table. The table policy can be perfect while the view still leaks or blocks.
Cause 7: The row was never saved where you are looking
Sometimes the read is correct and the write is the bug. The row you see in Table Editor may not be the row the app tried to save.
Check these:
- The form "saved" but the insert was blocked, and the app showed a success message anyway. Check the Network tab for the insert request, not just the read.
- The app saved to a different table, schema, or project than the page reads from.
- An update "succeeded" but changed zero rows because the update policy had no matching
SELECTpolicy, so the row was invisible to the update. - A Stripe or webhook flow created a record in one system while the app reads from another. If payments are involved, check the webhook mapping separately. The Lovable Stripe webhook fix covers that mapping failure.
If the insert request returns an error, fix the insert policy or the write path first. A read policy cannot return a row that was never written.
What not to do
Do not trade an empty page for a leak.
- Do not turn RLS off in production to make the list appear. With RLS off, anyone holding your publishable key, which ships in every browser bundle, can query the table directly.
- Do not add
using (true)for private data. That makes every row readable by everyone the policy applies to. - Do not put the
service_rolekey, or a newer secret key, in browser code. It bypasses RLS entirely. Keep it server-side only. - Do not backfill all orphan rows to one user to make a demo look full.
If you need a quick test, turn RLS off briefly in a development copy, or test the policy as a real user in the SQL Editor, then restore the protection. Production tables need policies, not an open door.
The 3-way test that proves the fix
After any fix, test three ways before you call it done:
- Logged out. Private tables should return
[]. Public tables should return only the rows meant to be public. - As User A. User A sees only User A's rows.
- As User B requesting User A's row by ID. User B should get nothing.

A hidden button is not the test. Three identities on the live URL are.
Also re-test the original symptom on the live site, in a private window, with a brand-new account. Testing only as the builder, who already owns the rows, hides the exact bug this post diagnoses.
This kind of empty-state failure is common when dashboards show different numbers across pages. If two pages disagree after your fix, the problem is usually a different filter, project, or policy per page, not a single global bug.
When to involve a specialist
Bring in help when:
- No owner column exists at all, so no owner policy can be written until the data model changes.
- Rows belong to teams, buyers and sellers, or multiple roles, and a single
user_idpolicy is not enough. - The app uses views, RPC functions, or Edge Functions that bypass or reshape RLS.
- The same symptom appears across many tables after a security change, and a one-table fix would leave the rest exposed.
- You need to backfill or migrate ownership and cannot prove who owns each orphan row.
A note on evidence
No first-hand JUHENZA client case is claimed here, and no reader screenshots are invented. The technical rules come from the Supabase RLS documentation, the PostgreSQL row security documentation, and the Supabase JavaScript reference linked at the end. The diagnosis order is a working method, not a guarantee for every schema.
If you want proof for your own app, ask for four things from any developer: the Network-tab status and body, the policy list per operation, the grant list per role, and the three-way test result. A promise that "RLS is fixed" without those four is not evidence.
FAQ
Why does Supabase return an empty array instead of an error?
Because a policy works like a filter added to every query. Rows the user is not allowed to see are simply left out. From the app's point of view, the query succeeded and found nothing. That is why a 200 with [] points to a policy or filter, while a 401, 403, or 42501 points to a grant or auth problem.
Why does it work for me but not for other users?
Often the rows were created while you were logged in, so they carry your user ID, or you are testing in a preview where your session is present. A new user has no rows, or the page queries before their session is ready. Test the live site in a private window with a brand-new account to see what real users see.
Why does a refresh sometimes fix it?
A refresh can give the session time to restore before the query runs. The first load queried as anon and got []. The second load queried as authenticated and got the rows. The fix is to wait for the session before querying private tables, not to tell users to refresh.
Is it safe to just turn RLS off?
No, not in production. Your publishable key is in the browser by design, so with RLS off anyone can query the table directly. Turning it off briefly in a development copy to confirm the cause is a reasonable diagnostic step. Production tables need policies.
Why does an insert succeed and then the row disappear?
The insert policy and the select policy are separate. A row can pass the insert check and then fail the select check, often because the insert did not set the owner, or the select policy compares a different column. Fix the write path so the row is created with the owner the select policy expects.
Why does preview work but the live site show no data?
Preview and the live site are different builds. The live site can have different env vars, a different project host, an older build, or a different signed-in state. Compare the Network-tab host, confirm production env vars, rebuild, and re-test on the live URL. Do not assume the preview proves the live site.
Where this fits and what to do next
This post is the diagnosis step. More Lovable and Supabase fixes are in the JUHENZA blog. Once you know the cause, use the Supabase RLS fix for Lovable apps for the full policy pattern, and integration consulting if the problem spans auth, webhooks, and another system. For the build side, see custom software development.
An empty list does not mean the data is gone. It means the app could not prove it should see the rows, asked too early, asked the wrong project, or filtered the rows away. Run the 2-minute Network-tab proof, fix the one cause you proved, then run the logged-out, User A, and User B test.
If you want help proving it on your own app, send a project brief. Describe the empty screen, the table, and what the Network tab shows. We will tell you which cause it is before quoting a fix.