minimatch: `10.0.2` release is a breaking change (`ERR_REQUIRE_ESM`) published as a patch
Recent release (tag: 10.0.2) bumps dependency brace-expansion to ^4.0.0 from ^2.0.0. However, the release 3.0.0 converts the package to ESM, which is effectively a breaking change for any consumer in the dependency chain.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 59
- Comments: 23 (2 by maintainers)
Commits related to this issue
- fix: pin minimatch to 10.0.1 (#599) Fixes #597 10.0.2 has been identified to contain regressions. Pin to 10.0.1. ref: https://github.com/isaacs/minimatch/issues/257 --- By submitting this pull req... — committed to aws/aws-cdk-cli by iankhou a year ago
- Use @isaacs/brace-expansion Fix: #257 — committed to Reality2byte/minimatch by isaacs a year ago
As a workaround, this can be solved using the
overridesfield ofpackage.json. For example if you are importing this package throughglob:cdk-assetsdepends on this package as well, seeing similar error to above.FYI - the vulnerability in brace-expansion that was the driver for bumping from ^2.0.0 to ^4.0.0 has now also been patched in 2.0.2, so going back to v 10.0.1 should be free from the vulnerability and avoid the cjs migration (provided you clear package-lock.json / yarn.lock / etc.)
it also broke my sanity project, here’s a solution that works. the previous solutions in this discussion did not work, i had to supplement them and now everything is successful.
fixing commit — https://github.com/mbozhik/arka/commit/a3639fefe1eddfeed8f7be55d28f39477d7a095f
Fix on my side (for now) is to force all packages to use 10.0.1 instead using:
The actual problem appears to be the fact brace-extensions jumped 2 major versions. (2.x to 4.x) somewhere in the chain of dependencies.
EDIT: Missed that someone already shared this.
This was all mentioned in the original vulnerability issue as well https://github.com/isaacs/minimatch/issues/254
In my case, I am depending on this package via
ts-config-schema-generator:Example of the kind of errors that can be seen due to import with a CJS style module-resolution