Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Throws "Uncaught TypeError: Failed to execute 'contains' on 'Node': parameter 1 is not of type 'Node'." error #1114

Closed
1 task done
tniezurawski opened this issue Feb 8, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@tniezurawski
Copy link

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

v1.1.3

Expected Behavior

Should not throw errors

Actual Behavior

We use rrweb through Sentry's Replay integration. It's quite nondeterministic or I wasn't able to find the root cause but for some interactions that a user makes we see a huge way of these errors:

Uncaught TypeError: Failed to execute 'contains' on 'Node': parameter 1 is not of type 'Node'.
    at c (mutation.js:131:1)
    at e.emit (mutation.js:192:11)
    at e.unlock (mutation.js:498:1)
    at index.js:233:1
    at Array.forEach (<anonymous>)
    at lt (index.js:233:1)
    at ct (index.js:111:9)
    at mousemoveCb (index.js:248:1)
    at Ze.e.mousemoveCb (observer.js:526:1)
    at observer.js:63:5
    at utils.js:95:1
    at HTMLDocument.<anonymous> (observer.js:84:5)
    at HTMLDocument.<anonymous> (utils.js:95:1)
    at HTMLDocument.r (helpers.ts:98:17)

Steps to Reproduce

It's quite nondeterministic or I wasn't able to find the root cause so I can't give steps to reproduce.
I hope someone has seen this before or authors would consider some defensive code in this area (please look at additional info).

Testcase Gist URL

No response

Additional Information

I believe the error is pointing to these exact lines:

https://github.com/rrweb-io/rrweb/blob/rrweb@1.1.3/packages/rrweb/src/record/mutation.ts#L273-L275

I also see a diff between master and rrweb@1.1.3. It looks like this code has changed so maybe master is not throwing errors in this area anymore 🤷‍♂️

https://github.com/rrweb-io/rrweb/compare/rrweb%401.1.3..master#diff-45cc3019725e113400ca8fb1da26625aa1dc4cf507713f452af569d1cf22a257L273

Unfortunately, I don't have full control over the version of rrweb so I can't test it with unreleased changes.

I decided to report anyway and will revisit the issue once a version of rrweb above 1.1.3 will be released :)

@tniezurawski tniezurawski added the bug Something isn't working label Feb 8, 2023
@YunFeng0817
Copy link
Member

Thanks for your report. It would be helpful to also upload the problematic event data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants