-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
react-dev-overlay ally.js causes MutationObserver infinite loop #17100
Comments
Any chance #20647 fixes this? |
Wow @lachlanjc thanks for noticing the connection to this issue. I will keep an eye on #20647 landing in a release and will test it out when it hits NPM. Judging from the diff I don't think it will make a difference, but maybe this vendored version of ally will not cause this problem. Thanks a lot. |
This should be fixed in |
@Timer @lachlanjc Yes, this issue is gone in |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
react-dev-overlay uses ally.js, which registers and responds to DOM mutations using a MutationObserver. If other MutationObservers are present, this can yield an infinite loop of mutation observing and mutating.
Specifically, in my case, I am using ProseMirror, which also observes the DOM. When the overlay opens and a ProseMirror instance is present, an infinite loop occurs.
Here's how it goes:
1 - The overlay initializes in a
useEffect
. As part of its initialization, it mutates the DOM2 - ProseMirror detects this mutation, and mutates the DOM too,
3 - ally.js's MutationObservers detect the mutation, and perform their own mutations
And round and round it goes from there... every time I get an error on this route, I have to kill the tab in task manager! It's really painful. Now that I've identified the error, I think I might edit node_modules to disable the underlying cause, but a proper solution would be great.
Thank you!
System information
Update
Indeed, commenting the ally initialization code from the
useEffect
in overlay resolves the issue locally.The text was updated successfully, but these errors were encountered: