chromatic-cli: building your Storybook fails (only with chromatic)
yarn: 1.22.5
npm: 6.14.9
$ CHROMATIC_PROJECT_TOKEN=xxx npx chromatic --exit-zero-on-changes
Chromatic CLI v5.5.0
https://www.chromatic.com/docs/cli
✔ Authenticated with Chromatic
→ Using project token '*******ncmi'
✔ Retrieved git information
→ Commit 'b0c8382' on branch 'master'; found 1 baseline commit
✔ Collected Storybook metadata
→ Storybook v6.1.11 for Vue; supported addons found: Actions, Backgrounds, Docs, Links, Viewport
✖ Building your Storybook
→ Command failed: build-storybook -- --output-dir /tmp/chromatic--31522-Y2kKkIx9HmLt
Publish your built Storybook
Verify your Storybook
Take snapshots of your stories
The CLI tried to run your build-storybook script, but the command failed. This indicates a problem with your Storybook. Here's what to do:
- Check the Storybook build log printed below.
- Run npm run build-storybook or yarn build-storybook yourself and make sure it outputs a valid Storybook by opening the generated index.html in your browser.
- Review the build-storybook CLI options at https://storybook.js.org/docs/configurations/cli-options/#for-build-storybook
Command failed with exit code 1: npm run --silent build-storybook -- --output-dir /tmp/chromatic--31522-Y2kKkIx9HmLt
ℹ Storybook build output:
build-storybook.log
build-storybook.log exists but is empty. If I run the failed command npm run --silent build-storybook -- --output-dir /tmp/chromatic--31522-Y2kKkIx9HmLt manually, the storybook gets build.
┆Issue is synchronized with this Asana task by Unito
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 36 (18 by maintainers)
@nikandlv I solved this issue by building the storybook manually and only upload it via the chromatic-cli:
Why is this closed? The issue is still here
Had the same issue and it was resolved by changing my package.json script from
npx chromatic --project-token abctochromatic --project-token abcThis is true.
I just hate private issue tracking because maybe some other guy or gal has the same problem I have. Maybe it will turn out the problems are different, but maybe they aren’t.
In this case CI isn’t the problem. The initial command above was executed in a default bash terminal on my development machine. If chromatic would just call
build-storybook, which I can do successfully manually from the same directory, then there wouldn’t be a problem. Sadly the initial bug report was two months ago, since then I think I just worked around the issue.https://github.com/chromaui/chromatic-cli/blob/7710e62fdaf7c5296ae94cc192c125710483dc81/bin/tasks/build.js#L46-L69
But there is in fact not much going on there, so I can’t say where the problem is at the moment.
I have the same problem for a while. I can build the storybook manually running
yarn build-storybookbut if I runnpx chromatic --project-token <<my-token>>it throw the storybook build error.error log
IMHO this error message doesn’t help or make sense sin my build-storybook cli is working properly. I wonder if downgrade will solve this problem, since it was working properly before.
Encountered the same issue when run
npx chromatic --project-token $CHROMATIC_PROJECT_TOKEN"build-storybooksucceeds locally, but cannot successfully run Chromatic CLIThe Chromatic
build-storybookstep is failing locally and in Github ActionsI have been having the same issue from my local machine as well. I have even tried previous branches which worked just fine.
Chromatic had been working as of 1/20/2021. Then we had removed the step from our CI for a bit. When we added it back in about a week ago, the “Building Your Storybook” step just hangs and does not move forward. I can run
build-storybookindependently just fine. I have tried upgrading to the newest version of Chromatic with no success, same issue.I had this issue and was able to resolve it by deleting all of my empty assets folders and their corresponding references in
.storybook/main.jsandng-package.json.Details
Angular
v13.3.7Storybookv6.5.4I didn’t receive any errors when building Storybook outside of the Github workflow, so I isolated the storybook build in the Github workflow and that yielded more descriptive errors, which allowed me to correct them.
Build error fixes
The Storybook build threw an error for all of my assets folders that were empty. I deleted those folders and removed their references from
.storybook/main.jsandng-package.jsonand the build succeeded.Working yml
I don’t know why the Storybook build behavior is different in the Github action. After resolving the errors I was able to remove the isolated Storybook build
runstep and everything worked fine.Here is my working workflow file:
The issue where the “build storybook” step hangs until it times out was traced back to the use of
npx(notnpm) v7. It has been fixed in #305 and released in 5.8.0.If you still encounter this after upgrading, please report/reopen. In case you cannot upgrade to the latest CLI, the workaround is to use
npm run chromatic(which expects you have such a script) rather thannpx chromatic.Worked for me. Thank you!
This also worked out for me, thanks for that bro!
I’m using chromatic@5.6.2, npm@7.7.6 and node v15.12.0
For me this issue was temporarily fixed by changing my npm version to
6.14.7, after referencing #213.Seeing a similar issue on my project (https://github.com/lab49/react-value-flash), but without any error output. I’m building on CircleCI. The task times out after 10 minutes, and I see the following output:
Same.
It seems to hang for a long period. Much much longer than it should take to show fail/success of storybook build process. It eventually shows that it failed.