← All errors · Supabase

Supabase select returns an empty array (no error)

Exact error

{ data: [], error: null }

What it means

With RLS enabled and no SELECT policy matching the user, Postgres silently filters out all rows. No error is raised.

Likely causes

How to fix it

  1. 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 );
  2. For public data, allow anon reads explicitly:

    create policy "Public read"
    on public.posts for select
    to anon, authenticated
    using ( true );
  3. Test in the SQL editor's role switcher, or check the user session in the client.

Related errors

Get new fixes weekly

No spam. Unsubscribe anytime. Privacy