import { StrictMode } from 'react' import { createRoot } from 'react-dom/client' import './index.css' import App from './App.tsx' import { hasSupabaseConfig } from './lib/supabaseClient' const root = document.getElementById('root')! /** * Production build safety gate. `isDemoMode` (supabaseClient.ts) already * guarantees demo-mode fallback can only happen in `npm run dev`/`preview` * of an unbuilt env — but this is the check that actually stops a * misconfigured *production* build from ever mounting the app (and * therefore from ever reaching Login/Dashboard with no data source). If * `VITE_SUPABASE_URL`/`VITE_SUPABASE_ANON_KEY` weren't baked in at build * time, fail immediately and visibly instead of silently doing nothing or * falling back to demo/mock WSRA data in front of real users. */ if (import.meta.env.PROD && !hasSupabaseConfig) { root.innerHTML = `
Configuration Error

PropertyHub can't start

This production build is missing Supabase configuration (VITE_SUPABASE_URL / VITE_SUPABASE_ANON_KEY). It will not fall back to demo data. Rebuild with real values in .env before deploying.

`; } else { createRoot(root).render( , ) }