diff --git a/src/components/panel/MessageComposer.tsx b/src/components/panel/MessageComposer.tsx index 4cd3298..37bec22 100644 --- a/src/components/panel/MessageComposer.tsx +++ b/src/components/panel/MessageComposer.tsx @@ -7,10 +7,15 @@ import { Card } from "@/components/ui/card"; import { toast } from "sonner"; import { createClient } from "@supabase/supabase-js"; -const supabase = createClient( - import.meta.env.VITE_SUPABASE_URL, - import.meta.env.VITE_SUPABASE_ANON_KEY -); +// Initialize Supabase client with proper error handling +const supabaseUrl = import.meta.env.VITE_SUPABASE_URL; +const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY; + +if (!supabaseUrl || !supabaseAnonKey) { + throw new Error('Supabase URL and Anon Key are required'); +} + +const supabase = createClient(supabaseUrl, supabaseAnonKey); export function MessageComposer() { const [message, setMessage] = useState("");