← All errors · SupabaseSupabase database & RLS errors
Supabase select returns an empty array (no error)
Exact error
{ data: [], error: null }What it means
This is a common surprise in Lovable, Bolt, Cursor, and v0 apps: the query looks successful, but Row Level Security hid every row. With RLS enabled and no SELECT policy matching the user, Postgres silently filters out all rows. No error is raised.
See also: official Supabase guide: Why is my select returning an empty data array and I have data in the table?.
Likely causes
- RLS enabled with no SELECT policy.
- Policy restricts to authenticated but the request is anonymous.
- Querying the wrong schema or table name.
How to fix it
Add a select policy:
create policy "Users can read their own todos" on public.todos for select to authenticated using ( (select auth.uid()) = user_id );For public data, allow anon reads explicitly:
create policy "Public read" on public.posts for select to anon, authenticated using ( true );Test in the SQL editor's role switcher, or check the user session in the client.
If Lovable, Bolt, or Cursor built the query, paste this so it adds a real SELECT policy instead of turning RLS off:
supabase.from(...).select() returns { data: [], error: null } even though the table has rows. Check Row Level Security: add a SELECT policy for the role the app uses (authenticated or anon), and confirm the client has a session if the policy uses auth.uid(). Do not disable RLS to fix this.
Still stuck after trying this? Get it fixed for $49, or you don't pay.
Prevent this next time
- Keep schema and RLS policies in migrations (`supabase migration new`) instead of editing production by hand.
- Test each policy as both an anonymous and a signed-in user before shipping.
FAQ
What does "Supabase select returns an empty array (no error)" mean?
This is a common surprise in Lovable, Bolt, Cursor, and v0 apps: the query looks successful, but Row Level Security hid every row. With RLS enabled and no SELECT policy matching the user, Postgres silently filters out all rows. No error is raised.
What usually causes it?
RLS enabled with no SELECT policy. Policy restricts to authenticated but the request is anonymous. Querying the wrong schema or table name.
How do I fix it?
1. Add a select policy: 2. For public data, allow anon reads explicitly: 3. Test in the SQL editor's role switcher, or check the user session in the client. 4. If Lovable, Bolt, or Cursor built the query, paste this so it adds a real SELECT policy instead of turning RLS off:
Last checked against official docs on . Sources: Official Supabase Knowledge Base: Why is my select returning an empty data array and I have data in the table?.
Related errors
- new row violates row-level security policy for table
- Supabase UPDATE succeeds with 0 rows and no error (RLS)
More Supabase errors and fixes →
Tools that help
- Railway: Deploy backends and databases; new users get $20 credit.
Some links on this page are affiliate links: if you sign up or buy through them, FixStack may earn a commission at no extra cost to you. Learn more.
Get new fixes weekly
No spam. Unsubscribe anytime. Privacy