The story of how RLS was the cause of data retrieval issues in Supabase [React x Supabase]

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 R…


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


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » The story of how RLS was the cause of data retrieval issues in Supabase [React x Supabase]." Kazutora Hattori | Sciencx - Sunday October 19, 2025, https://www.scien.cx/2025/10/19/the-story-of-how-rls-was-the-cause-of-data-retrieval-issues-in-supabase-react-x-supabase/
HARVARD
Kazutora Hattori | Sciencx Sunday October 19, 2025 » The story of how RLS was the cause of data retrieval issues in Supabase [React x Supabase]., viewed ,<https://www.scien.cx/2025/10/19/the-story-of-how-rls-was-the-cause-of-data-retrieval-issues-in-supabase-react-x-supabase/>
VANCOUVER
Kazutora Hattori | Sciencx - » The story of how RLS was the cause of data retrieval issues in Supabase [React x Supabase]. [Internet]. [Accessed ]. Available 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/
CHICAGO
" » The story of how RLS was the cause of data retrieval issues in Supabase [React x Supabase]." Kazutora Hattori | Sciencx - Accessed . https://www.scien.cx/2025/10/19/the-story-of-how-rls-was-the-cause-of-data-retrieval-issues-in-supabase-react-x-supabase/
IEEE
" » The story of how RLS was the cause of data retrieval issues in Supabase [React x Supabase]." Kazutora Hattori | Sciencx [Online]. Available: https://www.scien.cx/2025/10/19/the-story-of-how-rls-was-the-cause-of-data-retrieval-issues-in-supabase-react-x-supabase/. [Accessed: ]
rf:citation
» The story of how RLS was the cause of data retrieval issues in Supabase [React x Supabase] | Kazutora Hattori | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.