Replies: 7 comments 27 replies
-
Well, how did you solve this? |
Beta Was this translation helpful? Give feedback.
-
For future reader who are beginner in Supabase like I was, if your table has Row Level Security (RLS) enabled, add atleast a policy to allow reading for everyone. There is a template for that. Check out the guide |
Beta Was this translation helpful? Give feedback.
-
disabling rls does not work for me is there any thing that cause this? |
Beta Was this translation helpful? Give feedback.
-
for anyone ending up here, for nextjs this is the solution
|
Beta Was this translation helpful? Give feedback.
-
OK, I landed here because I had the same issue: RLS off, no errors, empty array using
and this migration guide Here is a minimal setup I used to get this working with their new server components package, Step1:uninstall install Step 2:
NEXT_PUBLIC_SUPABASE_URL=<my-url>
NEXT_PUBLIC_SUPABASE_ANON_KEY=<my-anon-key> Step 3:
import { createServerClient, type CookieOptions } from '@supabase/ssr'
export const supabase = (cookies: CookieOptions) => {
const cookieStore = cookies()
return createServerClient(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
{
cookies: {
get(name: string) {
return cookieStore.get(name)?.value
},
},
}
)
} Step 4:
import { supabase } from "@/utils/supabase";
import { cookies } from "next/headers";
export default async function Page() {
const { data } = await supabase(cookies).from("mytable").select();
return <pre>{JSON.stringify(data, null, 2)}</pre>;
}
} Step 5:Navigate to Step 6:Don't forget to turn RLS back on! |
Beta Was this translation helpful? Give feedback.
-
I have a same issue. I am using Astro framework with latest version 4.0 and trying to get images from Supabase storage but it returns the empty array [] and error is null. When I look at the supabase dashboard, it seems there was request and response on the server, but I don't know why it returns empty array... |
Beta Was this translation helpful? Give feedback.
-
Hello,
Can you please provide me a time schedule today to talk.
Im available all day.
Thank you
…On Wed, Sep 11, 2024, 23:42 Santiago Pacini ***@***.***> wrote:
It depends on your policy configuration, but in my case I failed to add
the “authenticated” role
—
Reply to this email directly, view it on GitHub
<#3780 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APXXP44NH2SCX6SICXBXPA3ZWDBMNAVCNFSM5HKXRHQ2U5DIOJSWCZC7NNSXTOSENFZWG5LTONUW63SDN5WW2ZLOOQ5TCMBWGE4TQMZQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
SOLVED
Hello i get empty array when i query my data?
is anyone know how to fix i
t
?
Beta Was this translation helpful? Give feedback.
All reactions