From 04667c4a8f6a207caa2cb4b43017b7672987453a Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Wed, 1 Oct 2025 00:01:19 +0000 Subject: [PATCH] Fallback getProfileById when table missing cgen-03d7ccafa8f0483ca6fbc43738805d28 --- client/lib/aethex-database-adapter.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/lib/aethex-database-adapter.ts b/client/lib/aethex-database-adapter.ts index 0aeeb4e1..651a67f3 100644 --- a/client/lib/aethex-database-adapter.ts +++ b/client/lib/aethex-database-adapter.ts @@ -188,9 +188,12 @@ export const aethexUserService = { } if (isTableMissing(error)) { - throw new Error( - 'Supabase table "user_profiles" is missing. Please run the required migrations.', - ); + console.warn('user_profiles table missing during getProfileById - returning local fallback if available'); + try { + const raw = localStorage.getItem(`demo_profile_${userId}`); + if (raw) return JSON.parse(raw) as AethexUserProfile; + } catch {} + return null; } throw error;