import { createRoot } from 'react-dom/client' import App from './App.tsx' import './index.css' const rootElement = document.getElementById('root'); if (!rootElement) { throw new Error('Root element #root was not found.'); } const escapeHtml = (value: string) => value .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, '''); const renderStartupError = (title: string, error: unknown) => { const details = error instanceof Error ? `${error.name}: ${error.message}` : String(error); const stack = error instanceof Error && error.stack ? error.stack : ''; rootElement.innerHTML = `
The app failed before it could render. This usually means a runtime error or a hosting issue serving the wrong file for a script request.
${escapeHtml(details)}${stack ? `\n\n${escapeHtml(stack)}` : ''}