-
Notifications
You must be signed in to change notification settings - Fork 27k
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 causes 100% CPU #19893
Comments
Just be curious, a question that is not related to this issue: I see that every next.js issue has a |
It's synced to our project management software, they're sprint points yeah. |
This bundles ally.js into Next.js itself to upgrade a dependency they have pinned. I tried every other major focus trap solution, even those used by some modal libraries, and they all failed. `ally.js` is the only library that can do it correctly, so we're going to stick with it. I also removed the `maintain/disabled` as we have a overlay that would effectively result in the same. This reduces CPU strain. --- Fixes vercel#19893 Fixes vercel#14369 Closes vercel#14372
This bundles ally.js into Next.js itself to upgrade a dependency they have pinned. I tried every other major focus trap solution, even those used by some modal libraries, and they all failed. `ally.js` is the only library that can do it correctly, so we're going to stick with it. I also removed the `maintain/disabled` as we have a backdrop that would effectively result in the same. This reduces CPU strain. --- Fixes #19893 Fixes #14369 Closes #14372
I can confirm that |
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
My web page will have 100% CPU usage in development mode when an error causes.
To Reproduce
123456789
in the textarea.Expected behavior
The CPU usage is normal.
Screenshots
System information
Additional context
I use ProseMirror in my application, which is a text editor that doesn't depend on React. ProseMirror has a lot of DOM manipulation, including MutationObserver.
react-dev-overlay uses ally.maintain.disabled to observe DOM manipulations and stop them, which also use MutationObserver.
After some debugging, I think the reason is: when a ProseMirror error occurs, react-dev-overlay and ProseMirror will observe each other's DOM manipulation and they manipulate the DOM as a response. This causes an infinite loop and the CPU usage reaches 100%.
According to this, the simplest solution should be removing
ally.js
from react-dev-overlay, also consider thatally.js
hasn't been updated in nearly four years.The text was updated successfully, but these errors were encountered: