import React from 'react';
import ReactDOM from 'react-dom/client';
import { HashRouter } from 'react-router-dom';
// This function contains the actual app initialization
const initializeApp = async () => {
try {
// Dynamically import the main App component ONLY after Firebase is ready.
// This prevents a race condition where the app tries to use Firebase before it's loaded.
const { default: App } = await import('./App.tsx');
const rootElement = document.getElementById('root');
if (!rootElement) {
throw new Error("Could not find root element to mount to");
}
const root = ReactDOM.createRoot(rootElement);
root.render(
${errorMsg}
${e.stack}