From 7e33587d81bf20a7f02ded59149a1ed5edae7176 Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Sun, 23 Nov 2025 16:17:44 -0800 Subject: [PATCH] fix: add error handling for missing root element in main.tsx --- src/main.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.tsx b/src/main.tsx index 4c5b6c0..8ec0418 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -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(