Skip to content
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

Version 5.0.0 ERR_REQUIRE_ESM error #33

Closed
linusnorton opened this issue Oct 5, 2021 · 2 comments
Closed

Version 5.0.0 ERR_REQUIRE_ESM error #33

linusnorton opened this issue Oct 5, 2021 · 2 comments

Comments

@linusnorton
Copy link

Version 5.0.0 appears to use an import statement which breaks node.js builds expecting CommonJS modules:

09:49:43  internal/modules/cjs/loader.js:1015
09:49:43        throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
09:49:43        ^
09:49:43  
09:49:43  Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: node_modules/matcher/index.js
@sindresorhus
Copy link
Owner

@mojavelinux
Copy link

This is a very aggressive change for what is essentially a utility function. By making an application switch to ESM to use this library, it forces all users of that application to also switch to ESM. Please consider bundling a cjs file to ease the transition. It seems to be a matter of adding a "main" property to the package.json file that point to the cjs file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants