import React from 'react'; import ReactDOM from 'react-dom/client'; import App from './App'; const rootElement = document.getElementById('root'); // Global error handler for startup crashes (before React mounts) window.onerror = function(message, source, lineno) { console.error("Window Error Caught:", message, source, lineno); if (rootElement) { // Forcefully remove the static loading text and show error rootElement.innerHTML = `
${message}
${source} : ${lineno}
The system encountered a fatal error.
${e}