Skip to content

Commit be5b09e

Browse files
committed
Fix vanilla template with html
1 parent 2debb30 commit be5b09e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/app/src/sandbox/compile.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,15 +550,18 @@ async function compile({
550550
: '<div id="root"></div>'
551551
);
552552

553-
document.body.innerHTML = body;
554-
555553
if (lastHeadHTML && lastHeadHTML !== head) {
556554
document.location.reload();
557555
}
558556
if (manager && lastBodyHTML && lastBodyHTML !== body) {
559557
manager.clearCompiledCache();
560558
}
561559

560+
if (!firstLoad || process.env.LOCAL_SERVER) {
561+
// The HTML is loaded from the server as a static file, no need to set the innerHTML of the body
562+
// on the first run.
563+
document.body.innerHTML = body;
564+
}
562565
lastBodyHTML = body;
563566
lastHeadHTML = head;
564567
}

0 commit comments

Comments
 (0)