diff --git a/site/src/components/Repl/Output/Viewer.svelte b/site/src/components/Repl/Output/Viewer.svelte index 7602a56152..ba9b16afa4 100644 --- a/site/src/components/Repl/Output/Viewer.svelte +++ b/site/src/components/Repl/Output/Viewer.svelte @@ -159,6 +159,14 @@ if (ssr) removeStyles(); replProxy.eval(`${dom.code} + if (window.component) { + try { + window.component.$destroy(); + } catch (err) { + console.error(err); + } + } + document.body.innerHTML = ''; window.location.hash = ''; window._svelteTransitionManager = null;