amireh / happypack

Happiness in the form of faster webpack build times.
MIT License
4.24k stars 124 forks source link

Channel closed #258

Closed TchernyavskyDaniil closed 4 years ago

TchernyavskyDaniil commented 5 years ago

Hi, I have sometimes issue like this on the test server:

HappyThread[5]: unable to send to worker! Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
    at ChildProcess.target.send (internal/child_process.js:678:16)
    at processSend (/opt/testsites/projectdir/node_modules/happypack/lib/processSend.js:8:15)
    at Object.UnbufferedFd.send (/opt/testsites/projectdir/node_modules/happypack/lib/UnbufferedFd.js:9:3)
    at send (/opt/testsites/projectdir/node_modules/happypack/lib/HappyThread.js:38:20)
    at Object.compile (/opt/testsites/projectdir/node_modules/happypack/lib/HappyThread.js:146:7)
    at Object.compile (/opt/testsites/projectdir/node_modules/happypack/lib/HappyThreadPool.js:82:14)
    at HappyPlugin.compile (/opt/testsites/projectdir/node_modules/happypack/lib/HappyPlugin.js:194:14)
    at Object.HappyLoader (/opt/testsites/projectdir/node_modules/happypack/lib/HappyLoader.js:31:15)
    at LOADER_EXECUTION (/opt/testsites/projectdir/node_modules/loader-runner/lib/LoaderRunner.js:119:14)
    at runSyncOrAsync (/opt/testsites/projectdir/node_modules/loader-runner/lib/LoaderRunner.js:120:4)
    at iterateNormalLoaders (/opt/testsites/projectdir/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/opt/testsites/projectdir/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/opt/testsites/projectdir/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:43:16)
    at /opt/testsites/projectdir/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:79:9
    at /opt/testsites/projectdir/node_modules/graceful-fs/graceful-fs.js:90:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)

My config with Happypack:

const HappyPack = require('happypack');
const happyThreadPool = HappyPack.ThreadPool({ size: 6 });

module.exports = {
  ...
   module: {
    rules: [
      {
        test: /\.jsx?$/,
        use: 'happypack/loader?id=babel',
        exclude: /node_modules/,
      },
      // another loaders
    ]
  }
  ...
   plugins: [
    new HappyPack({
      id: 'babel',
      threadPool: happyThreadPool,
      loaders: ['babel-loader', 'cache-loader'],
    }),
    // another plugins
    ...
  ]

Can you explain to me please, what's wrong?

amireh commented 5 years ago

Hmm, it's difficult to tell from what we have...

1) Can you try disabling the cache-loader and see if that affects it? 2) Do you always get this? 3) Turn on the debug flag when you create the plugin please, it should then log what files it's currently processing, which may help us figure out what's going on

Thanks, let me know.

abhinavsingi commented 4 years ago

@TchernyavskyDaniil - What was causing your issue? I'm also facing it and everytime not just sometimes.