diff --git a/src/runtime/main.ts b/src/runtime/main.ts index ceb260d1..b77def6d 100644 --- a/src/runtime/main.ts +++ b/src/runtime/main.ts @@ -34,11 +34,16 @@ export function revive(islands: Record) { const tag = node!.nodeType === 8 && ((node as Comment).data.match(/^\s*frsh-(.*)\s*$/) || [])[1]; if (tag) { + const startNode = node!; const children = []; const parent = node!.parentNode; while ((node = node!.nextSibling) && node.nodeType !== 8) { children.push(node); } + startNode.parentNode!.removeChild(startNode); + if (node) { + node.parentNode?.removeChild(node); + } const [id, n] = tag.split(":"); render( h(islands[id], ISLAND_PROPS[Number(n)]),