import { createRoot } from "react-dom/client";
import React, { Suspense, lazy } from "react";
import "./index.css";
// Lazy load App to ensure main.tsx can execute even if App has import errors
const App = lazy(() => import("./App"));
const LoadingScreen = () => (
INITIALIZING AETHEX OS...
);
const renderApp = () => {
console.log('[AeThexOS] Starting RenderApp...');
const rootElement = document.getElementById("root");
if (rootElement) {
try {
console.log('[AeThexOS] Creating Root...');
const root = createRoot(rootElement);
console.log('[AeThexOS] Rendering App...');
root.render(
}>
);
} catch (e) {
console.error('[AeThexOS] Critical render error:', e);
// Force visible error
document.body.innerHTML += 'REACT CRASH: ' + String(e) + '
';
}
} else {
console.error("Failed to find the root element");
document.body.innerHTML = 'NO ROOT ELEMENT FOUND
';
}
};
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", renderApp);
} else {
renderApp();
}