You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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"
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
The text was updated successfully, but these errors were encountered: