fix: add error handling for missing root element in main.tsx

This commit is contained in:
Ben Allfree
2025-11-23 16:17:44 -08:00
parent a92de9ca3f
commit 7e33587d81
+6 -1
View File
@@ -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 />