webpack/loader-runner

I encountered some bad cases when using thread-loader on windows

YourWildDad opened this issue · 0 comments

When I used thread-loader to speed up compilation, I encountered a bad case on windows. When I refrence the es5-ext package, thread-loader will report the following error:

ERROR in ./node_modules/es5-ext/string/#/ends-with/index.js
Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 0)
EISDIR: illegal operation on a directory, read
    at PoolWorker.fromErrorObj (D:\Development\test-thread-loader\node_modules\thread-loader\dist\WorkerPool.js:346:12)
    at D:\Development\test-thread-loader\node_modules\thread-loader\dist\WorkerPool.js:219:29
    at mapSeries (D:\Development\test-thread-loader\node_modules\neo-async\async.js:3625:14)
    at PoolWorker.onWorkerMessage (D:\Development\test-thread-loader\node_modules\thread-loader\dist\WorkerPool.js:173:34)
    at D:\Development\test-thread-loader\node_modules\thread-loader\dist\WorkerPool.js:146:14
    at Socket.onChunk (D:\Development\test-thread-loader\node_modules\thread-loader\dist\readBuffer.js:40:9)
    at Socket.emit (events.js:314:20)
    at Socket.Readable.read (_stream_readable.js:507:10)
    at Socket.read (net.js:625:39)
    at flow (_stream_readable.js:1007:34)
 @ ./src/index.js 1:0-49 3:12-20

The minimum unit test for this error can be viewed at https://github.com/YourWildDad/test-thread-loader

I think it is because the loader-runner splits the resource fragment, which leads to abnormal reading of the file.

Please help to fix this error, good luck.