From d04e5ea0baf3b63a7bc99b472813719b3d365be4 Mon Sep 17 00:00:00 2001
From: Jarred Sumner <jarred@jarredsumner.com>
Date: Wed, 22 Dec 2021 22:46:34 -0800
Subject: [bun-framework-next] Handle edgecase where for some reason the
 document returned was empty

---
 packages/bun-framework-next/client.development.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'packages/bun-framework-next/client.development.tsx')

diff --git a/packages/bun-framework-next/client.development.tsx b/packages/bun-framework-next/client.development.tsx
index 5d5e96763..f3d5b03e4 100644
--- a/packages/bun-framework-next/client.development.tsx
+++ b/packages/bun-framework-next/client.development.tsx
@@ -370,7 +370,7 @@ export async function _boot(EntryPointNamespace, isError) {
       reactRoot.render(reactEl);
     }
   } else {
-    if (isError) {
+    if (isError || !domEl.hasChildNodes() || !("hydrate" in ReactDOM)) {
       ReactDOM.render(reactEl, domEl);
     } else {
       ReactDOM.hydrate(reactEl, domEl);
-- 
cgit v1.2.3

