question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module build failed with thread-loader for javascript modules

See original GitHub issue

Describe 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:

  1. Add thread-loader@2.1.3 dependency
  2. Add thread-loader to javascript webpack rule
  3. 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:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
chrisgbakercommented, Jul 13, 2021

Still seeing this issue running Storybook@latest, webpack@latest, and thread-loader@latest

0reactions
lisaschumanncommented, Jun 28, 2022
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found