rrweb-io / rrweb

record and replay the web

Home Page:https://www.rrweb.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

alecmocatta opened this issue · comments

Preflight Checklist

  • 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:

if ((n.parentNode as Element).tagName === 'TEXTAREA') {

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.

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.

⬆️ 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.

Fixed in #1445 ?