欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Cannot read property 'createChildCompiler' of undefined

程序员文章站 2022-06-07 13:12:50
...
Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 2)
Cannot read property 'createChildCompiler' of undefined
    at PoolWorker.fromErrorObj (/home/pikachu/WebstormProjects/manager-web/node_modules/thread-loader/dist/WorkerPool.js:258:12)

把这个改了
vue.config.js

module.exports = {
// 省略其他

  //添加web worker loader
  configureWebpack: config => {
    config.module.rules.push({
      test: /\.worker\.js$/,
      use: {
        loader: 'worker-loader',
        options: { inline: true }
      }
    })
  },
  // parallel: require('os').cpus().length > 1,
  parallel: false,
}

parallel: false 能通过编译了