From ff9aa7907388dfbfabf5c9dc28a95620d7e0104a Mon Sep 17 00:00:00 2001 From: Jon Meyers Date: Wed, 25 Oct 2023 11:51:44 +1100 Subject: [PATCH 1/2] fix svg properties --- examples/with-supabase/components/Code.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/with-supabase/components/Code.tsx b/examples/with-supabase/components/Code.tsx index d1e6cd5b9f39b..312d04ab8e2e8 100644 --- a/examples/with-supabase/components/Code.tsx +++ b/examples/with-supabase/components/Code.tsx @@ -10,9 +10,9 @@ const CopyIcon = () => ( viewBox="0 0 24 24" fill="none" stroke="currentColor" - stroke-width="2" - stroke-linecap="round" - stroke-linejoin="round" + strokeWidth="2" + strokeLinecap="round" + strokeLinejoin="round" > @@ -27,9 +27,9 @@ const CheckIcon = () => ( viewBox="0 0 24 24" fill="none" stroke="currentColor" - stroke-width="2" - stroke-linecap="round" - stroke-linejoin="round" + strokeWidth="2" + strokeLinecap="round" + strokeLinejoin="round" > From daad72797e3314fabd41d098d12ee05aac2bf794 Mon Sep 17 00:00:00 2001 From: Jon Meyers Date: Wed, 25 Oct 2023 11:59:28 +1100 Subject: [PATCH 2/2] catch error when cookies are written in server components --- examples/with-supabase/utils/supabase/server.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/examples/with-supabase/utils/supabase/server.ts b/examples/with-supabase/utils/supabase/server.ts index df613a522e2ed..2fbf5bfc75c07 100644 --- a/examples/with-supabase/utils/supabase/server.ts +++ b/examples/with-supabase/utils/supabase/server.ts @@ -3,6 +3,7 @@ import { cookies } from 'next/headers' export const createClient = () => { const cookieStore = cookies() + return createServerClient( process.env.NEXT_PUBLIC_SUPABASE_URL!, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!, @@ -12,10 +13,22 @@ export const createClient = () => { return cookieStore.get(name)?.value }, set(name: string, value: string, options: CookieOptions) { - cookieStore?.set({ name, value, ...options }) + try { + cookieStore.set({ name, value, ...options }) + } catch (error) { + // The `set` method was called from a Server Component. + // This can be ignored if you have middleware refreshing + // user sessions. + } }, remove(name: string, options: CookieOptions) { - cookieStore?.delete({ name, ...options }) + try { + cookieStore.delete({ name, ...options }) + } catch (error) { + // The `delete` method was called from a Server Component. + // This can be ignored if you have middleware refreshing + // user sessions. + } }, }, }