rrweb icon indicating copy to clipboard operation
rrweb copied to clipboard

[Bug]: Cannot read properties of null (reading 'tagName')

Open alecmocatta opened this issue 1 year ago • 2 comments

Preflight Checklist

  • [X] I have searched the issue tracker for a bug report that matches the one I want to file, without success.

What package is this bug report for?

rrweb

Version

2.0.0-alpha.12

Expected Behavior

No uncaught exceptions.

Actual Behavior

There is an uncaught exception triggering the window error event:

TypeError: Cannot read properties of null (reading 'tagName')

on this line: https://github.com/rrweb-io/rrweb/blob/3d1877cff83d9a018630674fb6e730050ceef812/packages/rrweb/src/record/mutation.ts#L444

Steps to Reproduce

In my app press cmd+backspace on any non-empty line in a contentEditable div. Unfortunately my app's not public yet.

Testcase Gist URL

No response

Additional Information

I use rrweb thru PostHog session replay and capture all backtraces from the window error event. Because whatever loads this script (I presume PostHog?) loads it without crossorigin set I initially just got a "Script error." error event. It was reproducing locally with the debugger open that I got the aforementioned error and tracked it down to the aforementioned line.

alecmocatta avatar Apr 09 '24 16:04 alecmocatta

To keep this issue alive, many of our customers have also reported seeing this error. We are using the same version noted above in our instrumentation library.

metal-messiah avatar May 08 '24 20:05 metal-messiah

⬆️ The way New Relic is currently planning on circumventing this until a bigger fix is implemented is to intercept the error using rrweb's errorHandler configuration, and flagging the error object in such a way as to not report it as a customer-based error.

metal-messiah avatar May 09 '24 17:05 metal-messiah

Fixed in #1445 ?

eoghanmurray avatar Jun 18 '24 14:06 eoghanmurray