import React from 'react'; import ReactDOM from 'react-dom/client'; import { App } from './App'; import { ErrorBoundary } from './ErrorBoundary'; // Last-resort fallback: if even rendering ErrorBoundary+App fails (say, a // syntax error in some lazy import), paint a visible message into #root // so the window isn't just black. window.onerror catches async errors // that escape React's boundaries. window.addEventListener('error', (e) => { const root = document.getElementById('root'); if (root && !root.firstChild) { root.innerHTML = `
` +
`Fatal: ${String(e.error ?? e.message)}\n\n${e.error?.stack ?? ''}`;
}
});
ReactDOM.createRoot(document.getElementById('root')!).render(