Could not resolve import "worker_threads" when trying to use in webSee original GitHub issue
I am trying to use the library as an ESM module like that:
import * as fflate from 'fflate';
But I am getting
Error: Could not resolve import "worker_threads" in "../../../node_modules/fflate/esm/node-worker.js".
esm/index.js I see the following line
import wk from './node-worker'; and if I change it to
import wk from './worker'; it works fine.
As I understand it tries to run node version worker in web for some reason. Does it miss some sort of condition to import proper worker?
I really need this so I am ready to work out a PR for that.
- Created 2 years ago
- Comments:9 (5 by maintainers)