This content originally appeared on DEV Community and was authored by Kazutora Hattori
Introduction
When I was building a map app using React and Supabase,
I was troubled by the browser console displaying "Data fetched: Array(0)" and no pins appearing, even though data was already in Supabase.
As it turns out, the cause was RLS (Row Level Security).
Symptom
Data exists in the Supabase table.
However, executing select('*')
in React returns Array(0)
.
No error occurs (i.e., communication was successful).
What I tried
Checked the URL and Anon key in .env
.
Checked the spelling of the table and column names.
Confirmed the existence of data in the Supabase console.
Still couldn't retrieve the data.
Cause: RLS (Row Level Security)
In Supabase, RLS may be automatically enabled for newly created tables.
When RLS is enabled, only authenticated users can read the data.
Solution
Supabase → "Table Editor" → Open the target table
Check "Enable RLS" in the top menu.
If it's blue (enabled), click it to disable (gray).
Now, you can retrieve data even with anonymous access.
The message Data fetched: [ {...} ]
appears, and you can add a pin to the map.
Summary
If Supabase reports "empty data" and no errors,
first check whether RLS is enabled.
This content originally appeared on DEV Community and was authored by Kazutora Hattori

Kazutora Hattori | Sciencx (2025-10-19T07:49:19+00:00) The story of how RLS was the cause of data retrieval issues in Supabase [React x Supabase]. Retrieved from https://www.scien.cx/2025/10/19/the-story-of-how-rls-was-the-cause-of-data-retrieval-issues-in-supabase-react-x-supabase/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.