amis icon indicating copy to clipboard operation
amis copied to clipboard

编译完成会报错

Open theojia opened this issue 4 years ago • 5 comments

报了一个与react-visibility-sensor相关的错误

ERROR in ./node_modules/react-visibility-sensor/dist/visibility-sensor.js Module not found: Error: Can't resolve 'ReactDOM' in 'xxxxxxx\node_modules\react-visibility-sensor\dist' 请确认一下~

theojia avatar Dec 14 '21 14:12 theojia

这个很久没改了,估计是 webpack 配置问题之类的,整理完整能复现的例子吧

nwind avatar Jan 13 '22 07:01 nwind

https://github.com/joshwnj/react-visibility-sensor/issues/148 这里找到了出处,但只有改了dist里面的内容才不报错,webpack 配置问题,但是具体怎么解决其实还是存疑

minzhenyu avatar Mar 30 '22 06:03 minzhenyu

joshwnj/react-visibility-sensor#148 这里找到了出处,但只有改了dist里面的内容才不报错,webpack 配置问题,但是具体怎么解决其实还是存疑

这个问题 有解决方案了吗

tangchaoren1 avatar Apr 08 '22 07:04 tangchaoren1

这个问题我研究了一下,最后通过别名解决了,大家遇到同样问题的可以参考一下

alias: {
    ReactDOM: path.join(_ROOTPATH, `node_modules/react-dom`),
},

theojia avatar Apr 08 '22 10:04 theojia

ReactDOM: path.join(_ROOTPATH, node_modules/react-dom),

in node_modules/React/index.js does not match the corresponding path on disk `react 这个问题遇到了吗

tangchaoren1 avatar Apr 09 '22 00:04 tangchaoren1