报错信息:
in ./node_modules/watchpack/lib/chokidar.js
Module parse failed: 'return' outside of function (4:1)
You may need an appropriate loader to handle this file type.
| try {
| module.exports = require("chokidar");
| return;
| } catch(e) {
| v3Err = e;
原因:
chokidarjs的作用是监听文件夹内容的变化
下载某个依赖时,莫名给我自动引入debug文件,查半天没发现代码错误。后面才知道我这个文件引入了一个未使用的依赖,而这个依赖并没有安装对应的插件,因为我的webpack中并没有debug。
解决办法
删除该引用即可