Fix: Resolve module import error
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.
This commit is contained in:
parent
96237c4c37
commit
17e570de84
@ -4,6 +4,8 @@ import { createRoot } from 'react-dom/client';
|
|||||||
import App from './App.tsx';
|
import App from './App.tsx';
|
||||||
import './index.css';
|
import './index.css';
|
||||||
|
|
||||||
|
// Make sure we wait for DOM content to be loaded
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const rootElement = document.getElementById("root");
|
const rootElement = document.getElementById("root");
|
||||||
|
|
||||||
if (!rootElement) {
|
if (!rootElement) {
|
||||||
@ -11,5 +13,8 @@ if (!rootElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createRoot(rootElement).render(
|
createRoot(rootElement).render(
|
||||||
|
<React.StrictMode>
|
||||||
<App />
|
<App />
|
||||||
|
</React.StrictMode>
|
||||||
);
|
);
|
||||||
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user