JamieMason / syncpack

Consistent dependency versions in large JavaScript Monorepos.
https://jamiemason.github.io/syncpack/
MIT License
1.34k stars 44 forks source link

TypeError: (0 , minimatch_1.minimatch) is not a function #199

Closed donhcd closed 4 months ago

donhcd commented 4 months ago

Description

yarn run syncpack list-mismatches and other commands all fail due to TypeError: (0 , minimatch_1.minimatch) is not a function

image

When I look at the code referenced by this, at node_modules/syncpack/dist/guards/can-add-to-group.js, I see this:

image

~I don't understand why this code is in the package -- is (0, minimatch_1.minimatch) ever expected to be callable? Is there something I'm doing wrong here that is causing me to end up in this bad code path?~ it seems like the comma operator essentially means that the parenthesized expression evaluates to the value of the last expression in the set of commas, so the comma thing is actually fine, but the code is broken because it should be referencing the capital minimatch_1.Minimatch. If I update the two cases of minimatch_1.minimatch it to instead be minimatch_1.Minimatch, I no longer get this error

Suggested Solution

change minimatch_1.minimatch to minimatch_1.Minimatch?

Help Needed

JamieMason commented 4 months ago

Possibly the version of minimatch installed is not the version syncpack needs.

donhcd commented 4 months ago

Thanks @JamieMason ! we had a resolution pinning minimatch to a much older version than what syncpack was requiring; removing that fixed the issue.

JamieMason commented 4 months ago

Great, glad it's all sorted 👍