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

bug: Cannot read properties of undefined (reading 'concat') at Option.collect #116

Closed
vonBrax opened this issue Feb 15, 2023 · 3 comments
Closed

Comments

@vonBrax
Copy link

vonBrax commented Feb 15, 2023

Description

Commands that use the source option seem to be throwing this error:

TypeError: Cannot read properties of undefined (reading 'concat')
at Option.collect [as parseArg] (...node_modules\syncpack\dist\option.js:38:21)

Steps to reproduce:

npx  syncpack list-mismatches -s "packages/*/package.json"

env:

  • syncpack: 9.0.0
  • node: 19.4.0
  • npm: 9.3.1
  • os: windows 10

Suggested Solution

Apparently the default/initial value for the previous parameter of the collect function was removed.
It was here:

syncpack/src/option.ts

Lines 30 to 35 in fa21deb

source: [
'-s, --source [pattern]',
'glob pattern for package.json files to read from',
collect,
[] as string[],
],

And removed here:

syncpack/src/option.ts

Lines 18 to 22 in 2cd34fd

source: [
'-s, --source [pattern]',
'glob pattern for package.json files to read from',
collect,
],

Issue can be fixed by adding back this line:

[] as string[],

@JamieMason
Copy link
Owner

Thanks @vonBrax I'll sort this today

@JamieMason
Copy link
Owner

Thanks for reporting, should be fixed in 9.0.2

@vonBrax
Copy link
Author

vonBrax commented Feb 15, 2023

Thank you for the awesome work and for the promptness in fixing the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants