Realtime 401 error in Nextjs #26932
-
I'm starting to think this is a bug because no matter what I do I always get a 401 error. I already have a setup for uploading images to their bucket and works fine, tried to use the same supabase instance and didn't work. I keep reading and I found about the ssr client, cool, no luck. I have tried every youtube video, docs, no luck. I see a guy in stackoverflow having the same issue, it just return 401 all the time, RLS enabled with all policies combinations, disabled, no luck. Is this a bug? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
All combinations, around 6hrs, all I get is "Error 401: Unauthorized" |
Beta Was this translation helpful? Give feedback.
-
It's been 9 days of emails and supabase still won't fix this issue, which at this point comes from them since I've done everything available and it's dumb because it isn't even hard to make this work but for me it's just 401. |
Beta Was this translation helpful? Give feedback.
-
Dear diary, supabase sent me an email suggesting the use of a policy I used in day 1 .... it's been 2 weeks of nonsense. ._. |
Beta Was this translation helpful? Give feedback.
-
Same thing! |
Beta Was this translation helpful? Give feedback.
-
401 can be grants are missing on the schema or tables. This usually comes up if something like Prisma is used. Prisma during migrations can delete the grants so the API no longer has access. This would also though mean any select operations from next.js would not work. A policy of |
Beta Was this translation helpful? Give feedback.
See the trouble shooting section here for some code to fix the grants if that is your issue.
https://supabase.com/partners/integrations/prisma
Prisma during migrations often wipes out Postgres grants to the public schema.