-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module #41
Comments
I had this issue too, because I was running the script from a CommonJS node context. My solution is to use |
Firstly, thank you for your reply . Does this mean we can't use the latest version ? Shouldn't the "ESM" conversion be done by the owner of the package? because as an end user, I can't do such detailed operations, I just use this package to optimize my images. English is not my native language, I hope I'm not misunderstood |
It's possible to use the latest version:
More information here. Most libraries however offer different contexts to use, I believe.. |
A commonjs should always be provided for a nodejs lib, there is 0 reason to bundle only esm because it makes it unusable for 90% of cases Please consider adding a babel transpiling step |
version :
The text was updated successfully, but these errors were encountered: