diff --git a/packages/runtime-dom/src/nodeOps.ts b/packages/runtime-dom/src/nodeOps.ts index c3a4f4ba642..16762580e98 100644 --- a/packages/runtime-dom/src/nodeOps.ts +++ b/packages/runtime-dom/src/nodeOps.ts @@ -76,7 +76,10 @@ export const nodeOps: Omit, 'patchProp'> = { insertStaticContent(content, parent, anchor, isSVG, start, end) { // before | first ... last | anchor const before = anchor ? anchor.previousSibling : parent.lastChild - if (start && end) { + // #5308 can only take cached path if: + // - has a single root node + // - nextSibling info is still available + if (start && (start === end || start.nextSibling)) { // cached while (true) { parent.insertBefore(start!.cloneNode(true), anchor)