Closed jonathborg closed 3 years ago
Please read the release notes.
I just used ES6 imports, still the same. I'm using ts-node and it's working with another libraries. Am I doing something wrong?
I'm having the same issues. Doesn't play well with webpack.
I'm going to have to stay on the old version for now.
I confirm what @lineape said, I am also having issue with Wepack 5.
I'm having the same issues. Doesn't play well with webpack.
It's the other way around. Webpack (or your Webpack config) doesn't play well with ESM.
I have updated my ESM guide with more info: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
@sindresorhus you've just broken pretty much every script that uses this library with a bundler. I get that Node 10 is EOL and Node 12 supports ESM, but seems a little overkill to just dump CommonJS support because of an arbitrary cutoff. Standards take time to change, change management itself is a slow moving thing, and a bridge needs to exist in between. My bundler does not have a chance any time soon of using native ESM, even though I run all my environments in Node 14. I guess I have to pin this to the older version indefinitely.
For what it's worth, bundlers had years to get ready for native ESM.
Users now expect packages to be native ESM (this package even required moving to ESM to fix some TypeScript problem). I could support a dual scheme, but I have chosen not to as it is difficult to set up correctly and requires more maintenance. I'm also hoping to push the community to move to ESM sooner than later, which will benefit everyone in the long run.
Out of curiosity, what bundler are you using? And does it have an issue open about ESM support?
Am using fusebox as the builder. Just currently confirming with @nchanged whether it's an issue with the bundler itself or not
I've read the notes and I still don't understand what I need to do to get this working with ts-node. Can someone please explain?
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/joe/Code/dompedro/automacao-efleet/node_modules/p-queue/dist/index.js require() of ES modules is not supported.
v7.0.0