[Bug]: window.CSSStyleSheet
is undefined while stopping the recording
#1399
Labels
bug
Something isn't working
Preflight Checklist
What package is this bug report for?
rrweb
Version
2.0.0-alpha.11
Expected Behavior
When stopping a recording with iframes no errors should be ideally thrown. Alternatively, these errors should be prevented with proper guards or properly handled using try-catch statements without sending them to the user's application.
Actual Behavior
Stopping a recording containing iframes, throws the following error:
As shown in the image, the error is getting triggered at:
rrweb/packages/rrweb/src/record/observer.ts
Line 862 in b2460a4
This issue is a continuation of the previously defined issue: #1057
Actual cause of the issue has not been debugged yet. We don't know why
win.CSSStyleSheet
becomes undefined.There were previous attempts to silence these errors:
window.CSSStyleSheet
#1088 adds a guard to prevent the error from occurring.However, no logic is in place to guard the error from occurring while unsubscribing, specifically, when the return function of the
initStylesheetObserver
is invoked:rrweb/packages/rrweb/src/record/observer.ts
Lines 861 to 870 in b2460a4
A similar situation can also take place over here:
rrweb/packages/rrweb/src/record/observer.ts
Lines 1021 to 1024 in b2460a4
Error associated with the above case:
Until the actual error is identified, we can simply add a guard to prevent them from occuring.
Steps to Reproduce
I will present the steps to reproduce the effect. However, I couldn't reproduce the cause.
win.CSSStyleSheet = undefined
above this line:rrweb/packages/rrweb/src/record/observer.ts
Line 862 in b2460a4
Testcase Gist URL
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: