当前位置:   article > 正文

react-draggable报错:Module parse failed: Unexpected token_./node_modules/react-draggable/build/cjs/draggable

./node_modules/react-draggable/build/cjs/draggable.js module parse failed: u

运行项目,终端出现如下报错:

in ./node_modules/_react-draggable@4.4.6@react-draggable/build/cjs/Draggable.js
Module parse failed: Unexpected token (78:10)
You may need an appropriate loader to handle this file type.
| y: position.y,
| prevPropsPosition: {
| ...position
| }
| };
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

经过react-draggable
github的issue查看,将package.json中react-draggable的版本改为4.4.5,重新下载依赖包即可解决。(注:npm下载有缓存,最好删掉依赖包再重新下载)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/338638
推荐阅读
相关标签
  

闽ICP备14008679号