versionGroups not working with multiple elements
See original GitHub issueDescription
I’m not sure if I’m using this feature correctly, but versionGroups is an array type which seems to imply it supports multiple entries. It works fine when I have one entry, but as soon as I add a second entry, it actually seems to break BOTH entries.
- Clone https://github.com/JasonGore/repro-syncpack
yarnyarn repro
Expected:
No syncpack errors.
Actual:
Syncpack seems to ignore versionGroups and errors:
λ yarn repro
yarn run v1.22.4
$ syncpack list-mismatches --prod --dev
✕ fs-extra
- 9.0.1 in dependencies of syncpack-repro-a
- 9.0.1 in dependencies of syncpack-repro-c
- 9.0.1 in dependencies of syncpack-repro-a
- 8.0.1 in dependencies of syncpack-repro-b
- 9.0.1 in dependencies of syncpack-repro-c
✕ node-fetch
- 2.6.1 in dependencies of syncpack-repro-a
- 2.6.1 in dependencies of syncpack-repro-c
- 2.6.1 in dependencies of syncpack-repro-a
- 2.4.1 in dependencies of syncpack-repro-b
- 2.6.1 in dependencies of syncpack-repro-c
✕ uuid
- 6.0.0 in dependencies of syncpack-repro-a
- 8.3.0 in dependencies of syncpack-repro-c
- 6.0.0 in dependencies of syncpack-repro-a
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
If you just delete the second entry versionGroups in package.json from:
"versionGroups": [
{
"dependencies": ["fs-extra", "node-fetch"],
"packages": ["syncpack-repro-b"]
},
{
"dependencies": ["uuid"],
"packages": ["syncpack-repro-c"]
}
]
to:
"versionGroups": [
{
"dependencies": ["fs-extra", "node-fetch"],
"packages": ["syncpack-repro-b"]
}
]
Then you actually see some of the errors resolving:
λ yarn repro
yarn run v1.22.4
$ syncpack list-mismatches --prod --dev
✕ uuid
- 6.0.0 in dependencies of syncpack-repro-a
- 8.3.0 in dependencies of syncpack-repro-c
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I would expect both entries to work based on the type, but beyond that, it actually seems like the second entry breaks both entries.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Found multiple elements error in React Testing Library
Error thrown by RTL. TestingLibraryElementError: Found multiple elements with the role "radio" and name `/to/i` Here are the matching elements: ...
Read more >Add more advanced features for groups · Issue #57
An element cannot be part of more than one group. They are automatially displayed. There is no option to decide if we want...
Read more >Create Multiple Element Groups
You can quickly create multiple element groups at the same time. Open the dossier you want to modify. Click the visualization to add...
Read more >Select multiple items across different groups
I'm trying to select every single asset to Mark for Export, and it only will select the groups, without selecting everything inside. Even...
Read more >Group or ungroup messages in your Inbox
Microsoft Outlook automatically groups items by date. ... Newer versionsOffice 2007 ... If the field that you want is not in the Group...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

It worked perfectly for my actual use case, which has 12 entries. Thanks for the quick fix!
Released in 5.6.10 🤞
Thanks for the handy repro, I have converted it into a test to catch any regressions: https://github.com/JamieMason/syncpack/blob/f4cb055845139be8f210ce1f992fa8e847311c80/src/commands/lib/installations/get-grouped-mismatched-dependencies.spec.ts#L217-L245
Please let me know if you run into any more problems, thanks.