Module not found: Can't resolve 'worker_threads' - libsquoosh
See original GitHub issueI am trying to use squoosh/lib in my react app but I am getting the following error
Failed to compile.
./node_modules/@squoosh/lib/build/index.js
Module not found: Can't resolve 'worker_threads' in 'path/to/@squoosh/lib/build
has anyone else been running into this issue?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Cannot find module: avif_node_enc_mt.worker-be931951.js ...
Describe the bug I wanted to try running cli on Win10 but I got error: PS C:\Users\konta> squoosh-cli --avif "{speed:5,cqLevel:18 ...
Read more >Cannot find module 'worker_threads' error in production
The code works fine when I run npm start in VS Code. But when build and copied in Ubuntu server, it show "Cannot...
Read more >Node.js multithreading with worker threads series - Snyk
The worker_threads module implements a form of threading that lets you add parallelism to your own application. Code executed in a worker thread...
Read more >Cannot find module 'worker_threads' - Glitch Support
I am getting such an error? In this project, I will make a bot and a site with Node.js and Express. I opened...
Read more >ImageMinimizerWebpackPlugin | webpack
sharp - High performance Node.js image processing, the fastest module to resize and compress JPEG, PNG, WebP, AVIF and TIFF images. Uses the...
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
Yeah, I can see that. We wrote squoosh.app, then we wrote a Squoosh CLI. Both completely independent and separate (although they do share the Wasm code). @atjn then extracted libsquoosh from the CLI, so that other build tools like Webpack, rollup etc could potentially make use of the image compression capabilities without having to shell out.
Squoosh the PWA remains independent, tho. The main reason is that very different approaches are valid in Node but not valid on the Web (mostly related to file size and lazy loading).
Let’s continue this on #1084