rrweb recorder no longer overflows the call stack
posthog-js@1.399.2
1 fixThis release1 fixBug fixesAI-tallied from the release notes
From the original release noteView original ↗
1.399.2
Patch Changes
- #4118
f630394Thanks @posthog! - Fix aRangeError: Maximum call stack size exceededoriginating from the shared rrwebpatch()helper. It patches shared globals such asElement.prototype.attachShadow(shadow-dom-manager) and the DOM/canvas observers, so multiple recorder instances or repeated start/stop cycles wrap the same global more than once. Previously an out-of-order restore silently no-op'd, leaving the wrapper in the call path; repeated cycles grew the wrapper chain without bound until a real call walked a chain deep enough to overflow the stack. Wrappers now delegate through a mutable per-layer link so any layer can be torn down even when newer wrappers sit on top of it, keeping the chain bounded. Recording behavior is unchanged. This applies the same fix as #4063 (fetch/XHR) to the shared helper so every rrweb-record caller inherits the bounded-chain behavior. (2026-07-10)
Fetched July 10, 2026
