Checking node existence (#174)

* added our package

* reverted back to old rrweb snapshot

* Array.from does not capture all elements added in the set, we have to manually iterate through the iterator

* package lock

* checking if nodes are in the parent before we try inserting them
This commit is contained in:
Filip Slatinac
2026-04-01 12:00:00 +08:00
committed by GitHub
parent 23220f1771
commit a242a105d3

View File

@@ -409,7 +409,11 @@ export class Replayer {
) {
parent.insertBefore(target, previous.nextSibling);
} else if (next && next.parentNode) {
parent.insertBefore(target, next);
// making sure the parent contains the reference nodes
// before we insert target before next.
parent.contains(next)
? parent.insertBefore(target, next)
: parent.insertBefore(target, null);
} else {
parent.appendChild(target);
}