Supabase SSR / Right way to implement Server Component client
Hey folks,
I'm working on setting up Supabase clients in my NextJS 14 project using Supabase SSR for auth. I'm using middleware to refresh sessions as recommended. I've encountered confusion with different recommendations for server and server component client implementations:
I initially used #1, and it worked fine. However, as I explore #2, it seems like it should work, but it doesn't. #2 throws exceptions saying server components cant set cookies.
Dropping the errors is concerning to me in case I do something wrong without even realizing.
Can someone help me understand what's going on?
-Who is trying to set cookies for server component clients? (I tried to debug but it only goes up to SupabaseAuthClient) -Why is supabase server client example dropping exceptions ok for middleware refresh case?
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.