当前位置: 首页>前端>正文

vuecli@4执行npm run build报错:Syntax Error: Thread Loader (Worker 2) The “from“ argument must be of

1、问题
Syntax Error: Thread Loader (Work 2)
The "from" argument must be of type string. Received undefined

语法错误:线程加载器(工作2)
“from”参数的类型必须为字符串。接收未定义

vuecli@4执行npm run build报错:Syntax Error: Thread Loader (Worker 2) The “from“ argument must be of,vue/cli@4执行npm run build报错:Syntax Error: Thread Loader (Worker 2) The “from“ argument must be of_错误提示,第1张

错误提示代码:

 error  in ./src/views/singaporeReport/pieSmokeLine.vue?vue&type=template&id=2ec3aa86&
 
Syntax Error: Thread Loader (Worker 2)
The "from" argument must be of type string. Received undefined

2、原因
vue-cli 使用 wokrer-loader 加载 web woker 时,使用 npm run build 有很大机率会打包失败,报错如上。

thread-loader 与 worker-loader 有冲突 。

3、解决方案
vue.config.js 配置 parallel: false 。构建正式环境关闭 thread-loader 。

vuecli@4执行npm run build报错:Syntax Error: Thread Loader (Worker 2) The “from“ argument must be of,vue/cli@4执行npm run build报错:Syntax Error: Thread Loader (Worker 2) The “from“ argument must be of_前端_02,第2张

最后再 npm run build 重新执行一遍打包命令就 OK 啦 ~


https://www.xamrdz.com/web/2c51960175.html

相关文章: