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

fix(utils): check validity of bundledDependencies before iteration #2960

Merged
merged 2 commits into from Dec 13, 2022

Conversation

davidmeirlevy
Copy link
Contributor

check validity of bundledDependencies before iteration

Description

According to NPM, bundledDependencies can also be a Boolean which stands for "all dependencies".

Motivation and Context

When using BundledDependencies according to NPM instructions, lerna fails to bootstrap, showing this error:
TypeError: collection is not iterable

How Has This Been Tested?

I Just added an extra safety test, so before you try to iterate a value, you should first validate that it's actually an array.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

According to NPM, bundledDependencies can also be a Boolean which stands for "all dependencies".
@davidmeirlevy davidmeirlevy changed the title check validity of bundledDependencies before iteration Bugfix: check validity of bundledDependencies before iteration Aug 3, 2021
@davidmeirlevy davidmeirlevy changed the title Bugfix: check validity of bundledDependencies before iteration fix(bootstrap) check validity of bundledDependencies before iteration Aug 3, 2021
@davidmeirlevy davidmeirlevy changed the title fix(bootstrap) check validity of bundledDependencies before iteration fix(bootstrap): check validity of bundledDependencies before iteration Aug 3, 2021
@JamesHenry JamesHenry changed the title fix(bootstrap): check validity of bundledDependencies before iteration fix(utils): check validity of bundledDependencies before iteration Dec 13, 2022
@JamesHenry JamesHenry merged commit 2517ffb into lerna:main Dec 13, 2022
@JamesHenry
Copy link
Member

JamesHenry commented Dec 13, 2022

Thank you @davidmeirlevy - I did however change it to go with a more robust approach for checking for an array, please take a look at the update I made: 2396bb6

rrhodes pushed a commit to rrhodes/lerna that referenced this pull request Jan 3, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants