问题描述
我已经几个月没有更新我的代码了。刚刚克隆它并安装了软件包。
现在,当我更改代码并且热重载/刷新尝试更新我的 DOM 时出现此错误。
Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
当我更新时:
<ul className={props.annotations.drawingEnabled ? 'absolute active' : 'absolute active'}>
<li>
<i className="far fa-undo" /> undo
</li>
</ul>
到:
<ul className={props.annotations.drawingEnabled ? 'absolute active' : 'absolute active'}>
<li>
something_new_at_this_place <i className="far fa-undo" /> undo
</li>
</ul>
这也发生在 SimpleBar https://github.com/Grsmto/simplebar/issues/548
我以前从来没有遇到过这些问题,现在我真的很困惑。 还尝试了较旧的 Node 版本并测试了较旧的提交。出现在 Firefox 和 Chrome 中。
FAST_REFRESH=false
@ .env 有效,但整个站点在代码更新时重新加载。
删除这两个导入解决了问题:
import '@mygit/fontawesome-pro/js/all.js';
import 'simplebar';
但为什么它以前有效?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)