mirror of
https://github.com/MeshEnvy/mesh-forge.git
synced 2026-05-07 22:04:52 +02:00
fix: add error handling for missing root element in main.tsx
This commit is contained in:
+6
-1
@@ -7,7 +7,12 @@ import App from "./App";
|
||||
|
||||
const convex = new ConvexReactClient(import.meta.env.VITE_CONVEX_URL as string);
|
||||
|
||||
createRoot(document.getElementById("root")!).render(
|
||||
const rootElement = document.getElementById("root");
|
||||
if (!rootElement) {
|
||||
throw new Error("Root element not found");
|
||||
}
|
||||
|
||||
createRoot(rootElement).render(
|
||||
<StrictMode>
|
||||
<ConvexAuthProvider client={convex}>
|
||||
<App />
|
||||
|
||||
Reference in New Issue
Block a user