Module build failed with thread-loader for javascript modules
See original GitHub issueDescribe the bug When javascript modules build with thread-loader, building fails with the error:
ERROR in ./.storybook/generated-entry.js
Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 0)
ENOENT: no such file or directory, open '/storybook-webpack-config-with-thread-loader/.storybook/generated-entry.js'
at PoolWorker.fromErrorObj (/storybook-webpack-config-with-thread-loader/node_modules/thread-loader/dist/WorkerPool.js:262:12)
at /storybook-webpack-config-with-thread-loader/node_modules/thread-loader/dist/WorkerPool.js:204:29
at mapSeries (/storybook-webpack-config-with-thread-loader/node_modules/neo-async/async.js:3625:14)
at PoolWorker.onWorkerMessage (/storybook-webpack-config-with-thread-loader/node_modules/thread-loader/dist/WorkerPool.js:170:35)
at /storybook-webpack-config-with-thread-loader/node_modules/thread-loader/dist/WorkerPool.js:152:14
at Socket.onChunk (/storybook-webpack-config-with-thread-loader/node_modules/thread-loader/dist/readBuffer.js:36:9)
at Socket.emit (events.js:321:20)
at Socket.Readable.read (_stream_readable.js:527:10)
at Socket.read (net.js:618:39)
at flow (_stream_readable.js:998:34)
at emitReadable_ (_stream_readable.js:591:3)
at processTicksAndRejections (internal/process/task_queues.js:83:21)
@ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/generated-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=true main[2]
To Reproduce Steps to reproduce the behavior:
- Add
thread-loader@2.1.3
dependency - Add
thread-loader
to javascript webpack rule - Run
start-storybook
Expected behavior There should be no error.
Code snippets https://github.com/lozinsky/storybook-webpack-with-thread-loader
Additional context
I guess that webpack-virtual-modules
plugin
https://github.com/storybookjs/storybook/blob/3bcaaeb769ef21234837cc755a27c056092d1f00/lib/core/src/server/preview/iframe-webpack.config.js#L52-L60
is not compatible with thread-loader
.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:10 (2 by maintainers)
Top Results From Across the Web
3 - Stack Overflow
Module build failed (from ./node_modules/html-loader/dist/cjs.js): ; "version" · "0.0.0" · "license" ; "scripts" · "start" · "electron-webpack dev" ; " ...
Read more >thread-loader | webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >ts-loader - npm
Code Splitting and Loading Other Resources; Declarations (.d.ts); Failing the build on TypeScript compilation error; baseUrl / paths module ...
Read more >Băltuță.eu: Web Development Rants
webpack.config.js module.exports = { // your config performance: ... This will error rather than show a warning, causing the build to fail.
Read more >Build fails but development runs fine [SOLVED] - Vue Forum
Module build failed (from ./node_modules/thread-loader/dist/cjs.js): Thread Loader (Worker 0) Cannot read property 'range' of null Occurred ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Still seeing this issue running Storybook@latest, webpack@latest, and thread-loader@latest
Same for @nuxtjs/storybook!