question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Uncaught TypeError: Illegal invocation with react-dom

See original GitHub issue
  • I have searched for existing issues that already reported this problem and found none

Describe the bug when react-dom is @required to a user script, react-dom will use window.event, and access window.event will cause Illegal invocation

https://github.com/facebook/react/blob/main/packages/react-dom/src/client/ReactDOMHostConfig.js#L371-L374

image

and after I attach window.__t__ = t

image

don’t know how to trigger this behavior, after this error following setState calls will fail

To Reproduce Note that issues without a reproduction may be closed immediately! Steps to reproduce the behavior: 1. 2. 3.

Expected behavior A clear and concise description of what you expected to happen.

Actual behavior If applicable, add screenshots to help explain your problem.

What is the result in the upcoming release? WARNING! Do an export in settings before testing!

Environment:

  • OS: macOS
  • Browser: chrome
  • Browser Version: 100.0.4896.127
  • Violentmonkey Version: 2.13.0 & Violentmonkey BETA 2.13.0.18

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tophfcommented, Apr 16, 2022

Thanks, fixed in bc08540a. Test build: zip

0reactions
magicdawncommented, Apr 16, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: "Uncaught TypeError: Illegal invocation" · Issue #986
When scrolling in a List component, do I get the exception Uncaught TypeError: Illegal invocation in Chrome. The error is thrown at ...
Read more >
TypeError: Illegal Invocation - Stack Overflow
This error seems to be generated by a number of browsers (Chrome, Opera, Safari, mobile browsers) on many platforms (Android, Windows 10, OS...
Read more >
[Solved]-TypeError: Illegal Invocation-Reactjs - appsloveworld
In our case, we only saw Type Error: Illegal Invocation, but didn't see the other error message variants based on different browsers that...
Read more >
"Illegal invocation" errors in JavaScript - Matias Kinnunen
An "illegal invocation" error is thrown when calling a function whose this keyword doesn't refer to the object where it originally did. In...
Read more >
destroy is not a function at safelycalldestroy - You.com
Today or yesterday this bug started showing up, where when React hot-loads in response to a change in a file, it crashes every...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found