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

Trailing comma in statics configuration "-s" will break chromatic upload #15614

Closed
apalumbo opened this issue Jul 18, 2021 · 2 comments
Closed

Comments

@apalumbo
Copy link
Contributor

Describe the bug
A trailing comma in "-s" commandline parameter leads to an extra empty element in statics that will break chromatic upload.
For us it was due to an extra whitespace after one of the path of "-s", but it was really tricky to spot it.

To Reproduce

Given the command line:

build-storybook -c .storybook -s ./public,./stories/assets, ./other/assets

the whitespace after "stories/assets," will lead to an extra element in process.argv that will be ignored by commander (the lib used to handle the command line).
The function used to parse the value of the "-s" option will just split for "," and will return 3 elements, the last one will be an empty string; this will break the upload to chromatic.

I will provide a PR for trimming and stripping the empty elements in the process of "-s"

System
System:
OS: macOS 10.15.7
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Binaries:
Node: 14.17.1 - ~/.nvm/versions/node/v14.17.1/bin/node
Yarn: 1.22.5 - ~/.yarn/bin/yarn
npm: 7.19.1 - ~/.nvm/versions/node/v14.17.1/bin/npm

@shilman
Copy link
Member

shilman commented Jul 22, 2021

Ta-da!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.0-alpha.19 containing PR #15615 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Jul 22, 2021
@shilman
Copy link
Member

shilman commented Jul 22, 2021

w00t!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.3.5 containing PR #15615 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb upgrade

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