The error "TypeError: Importing a module script failed" suggests an issue with module loading in the frontend. This commit aims to address the error, likely by reviewing and correcting module imports, especially in `src/main.tsx` and `index.html`, to ensure proper module loading and prevent runtime errors.
21 lines
466 B
TypeScript
21 lines
466 B
TypeScript
|
|
import React from 'react';
|
|
import { createRoot } from 'react-dom/client';
|
|
import App from './App.tsx';
|
|
import './index.css';
|
|
|
|
// Make sure we wait for DOM content to be loaded
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const rootElement = document.getElementById("root");
|
|
|
|
if (!rootElement) {
|
|
throw new Error("Root element not found!");
|
|
}
|
|
|
|
createRoot(rootElement).render(
|
|
<React.StrictMode>
|
|
<App />
|
|
</React.StrictMode>
|
|
);
|
|
});
|