From cc66e96f6110f483e01df88ab3ffc3bc75d10520 Mon Sep 17 00:00:00 2001 From: dwindown Date: Tue, 23 Dec 2025 14:52:40 +0700 Subject: [PATCH] Fix 'Body already consumed' error by using req.clone() - Use req.clone().json() to handle multiple reads from same request - This happens when React Strict Mode fires requests twice - Cloning the request allows reading body multiple times safely --- supabase/functions/create-google-meet-event/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/supabase/functions/create-google-meet-event/index.ts b/supabase/functions/create-google-meet-event/index.ts index efcf5cf..fc6b6ee 100644 --- a/supabase/functions/create-google-meet-event/index.ts +++ b/supabase/functions/create-google-meet-event/index.ts @@ -85,7 +85,8 @@ serve(async (req: Request): Promise => { const supabaseServiceKey = Deno.env.get("SUPABASE_SERVICE_ROLE_KEY")!; const supabase = createClient(supabaseUrl, supabaseServiceKey); - const body: CreateMeetRequest = await req.json(); + // Clone the request before reading body to handle multiple reads + const body: CreateMeetRequest = await req.clone().json(); console.log("Creating Google Meet event for slot:", body.slot_id); // Get platform settings