jessetane / queue

Asynchronous function queue with adjustable concurrency
MIT License
764 stars 66 forks source link

rror [ERR_REQUIRE_ESM]: require() of ES Modulee #102

Open ryanhugh opened 1 year ago

ryanhugh commented 1 year ago

The latest version 7.0.0 causes this error:

error [ERR_REQUIRE_ESM]: require() of ES Module /.../node_modules/queue/index.js from /mycode/sandbox.ts not supported.
Instead change the require of index.js in /mycode/sandbox.ts to a dynamic import() which is available in all CommonJS modules.

I didn't get this error in v6. I'm about to downgrade to v6. I don't have type: module in my package.json and cannot add that. All the other packages work without that.

jessetane commented 1 year ago

v7+ are ESM only but feel free to use older versions if you need commonjs support

ItaloSa commented 1 year ago

I got this error running with Nestst. Seems they don't support ESM yet (https://github.com/nestjs/nest/issues/11046#issuecomment-1416983059). Downgrade to ^6 solves.

kashesandr commented 9 months ago

Faced with this as well