import { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; import App from './App.tsx'; import './index.css'; import ErrorBoundary from './ErrorBoundary'; // Error boundary for the entire application const renderApp = () => { try { const rootElement = document.getElementById('root'); if (!rootElement) { console.error('Root element not found'); return; } createRoot(rootElement).render( ); } catch (error) { console.error('Error rendering application:', error); // Render a fallback UI in case of error const rootElement = document.getElementById('root'); if (rootElement) { rootElement.innerHTML = `

Application Error

Sorry, something went wrong while loading the application.

Error details: ${error instanceof Error ? error.message : String(error)}

`; } } }; // Disable Vite's error overlay to prevent WebSocket connection attempts window.addEventListener('error', (event) => { event.preventDefault(); console.error('Caught error:', event.error); return true; }); // Disable Vite's HMR client if (import.meta.hot) { import.meta.hot.decline(); } renderApp();