0
点赞
收藏
分享

微信扫一扫

Module parse failed Unexpected token

梅梅的时光 2022-02-22 阅读 241

这是react的4.01~4.03版本比较坑的地方,先看报错
./src/index.js 1:43
Module parse failed: Unexpected token (1:43)
File was processed with these loaders:

  • ./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
  • ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
    You may need an additional loader to handle the result of these loaders.
    同样的代码在两台设备运行一台正常一台报错,仔细排查之后发现是文件的路径问题,不能运行的路径含有单引号字符Shine’lon
    ![报错路径](https://img-blog.csdnimg.cn/15ed8c59a2d146069a4b9faef8caf01a.png
    然后把文件复制到D盘,文件路径正常,问题就解决了正常运行.出现这种情况暂时也没有找到准确的解释,欢迎指点.
举报

相关推荐

0 条评论