-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
NotFoundError: Failed to execute 'removeChild' on 'Node' #920
Comments
It's removed and added again at the end of refresh so a partial layout isn't attempted. All the DOM manipulations are done while it's detached. This is meant to be the only point that it's detached though. |
So based on the lines below, it seems that the issue is:
Maybe we should perform a check for |
After a closer look, I notice
Perhaps something in another class is messing with the DOM in an unexpected way? |
Hey @Tyriar, the situation of another class messing with the DOM actually reproduces reliably now with hot module reloading in React applications. Here's a demo: https://codesandbox.io/s/xtermjs-dom-renderer-disposal-jsd75 useEffect(() => {
if (!divRef.current) {
return;
}
const terminal = new Terminal({
rendererType: "dom"
});
terminal.open(divRef.current);
terminal.write(`It has begun! ${Math.random()}`);
return () => {
// To cause this line to crash, modify some code in CodeSandbox.
// That'll cause a hot module reload (HMR), which removes the
// terminal's element *before* this disposal function is run.
terminal.dispose();
};
}, [divRef]); I'd be happy to send a PR that, say, changes the DOM renderer's |
@JoshuaKGoldberg yes please send a PR 🙂 |
👉 #2960 |
We also ran into this issue on SourceLair, at the same time with #919 (same user).
Seems like
rowContainer
can be detached fromterm.element
at some points 🤔.https://github.com/sourcelair/xterm.js/blob/6e9d60d76d6cfb3d279f9e58499ba62ca6af479c/src/Renderer.ts#L129-L131
Details
The text was updated successfully, but these errors were encountered: