Skip to content

Commit 1149d3a

Browse files
committed
I can't recreate a scenario for this case in testing, so add a warning and a speculative mitigation
1 parent d281080 commit 1149d3a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/rrweb/src/record/mutation.ts

+7
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,13 @@ export default class MutationBuffer {
295295
nextId = nextSibling && this.mirror.getId(nextSibling);
296296
}
297297
if (nextId === -1) {
298+
// sibling not included in addedNodes, but
299+
// no id as not yet serialized?
300+
console.warn(
301+
"Couldn't record new node. Couldn't find mirror id for nextSibling:",
302+
nextSibling,
303+
);
304+
n = null; // don't iterate to previousSibling as we haven't successful serialized this node
298305
continue;
299306
}
300307
const sn = serializeNodeWithId(n, {

0 commit comments

Comments
 (0)