question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

versionGroups not working with multiple elements

See original GitHub issue

Description

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.

  1. Clone https://github.com/JasonGore/repro-syncpack
  2. yarn
  3. yarn 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:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
JasonGorecommented, Sep 17, 2020

It worked perfectly for my actual use case, which has 12 entries. Thanks for the quick fix!

1reaction
JamieMasoncommented, Sep 17, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found