4

I am not able to get chromatic cli v5.4.0 to build my storybook. It worked the first time and then hangs on subsequent attempts.

  ➜  my-project git:(storybook-poc) ✗ yarn chromatic
  yarn run v1.22.10
$ npx chromatic --project-token xxxfooxxx

Chromatic CLI v5.4.0
https://www.chromatic.com/docs/cli

  ✔ Authenticated with Chromatic
    → Using project token '*******xxx'
  ✔ Retrieved git information
    → Commit 'f392eff' on branch 'storybook-poc'; found 1 baseline commit
  ✔ Collected Storybook metadata
    → Storybook v6.1.3 for React; supported addons found: Actions, Backgrounds, Docs, Links, Viewport
  ⠼ Building your Storybook
    → Running command: build-storybook -- --output-dir /var/folders/1t/9d_7zrws2p52d2gw918m16wr0000gq/T/chromatic--50970-DBkh6i7fBaPe
    Publish your built Storybook
    Verify your Storybook
    Take snapshots of your stories

The output of that var directory never contains anything more then the following, despite leaving running for several minutes:

ls -la /var/folders/1t/9d_7zrws2p52d2gw918m16wr0000gq/T/chromatic--50970-DBkh6i7fBaPe

total 0
drwx------    2 stefan  staff    64  1 Dec 15:50 .
drwx------@ 190 stefan  staff  6080  1 Dec 15:51 ..

I am working around this for now by using the following command, so perhaps something permissions based ‍♂️. Suggestions welcome!

./node_modules/.bin/chromatic --project-token=xxxxfooxxxx
RobC
  • 22,977
  • 20
  • 73
  • 80
Opentuned
  • 1,477
  • 17
  • 21
  • Try running `yarn build-storybook` directly. Does that successfully build a static version of your Storybook? – Gert Hengeveld Jan 06 '21 at 08:50
  • Yes, building the storybook directly in yarn is ok, but as an artefact of the chromatic build it just hangs. Also raised here: https://github.com/chromaui/chromatic-cli/issues/213#issuecomment-754989987 – Opentuned Jan 06 '21 at 12:52
  • 1
    Thanks, I've released a potential fix in `chromatic@5.5.1-dev.0`. Can you verify it works? – Gert Hengeveld Jan 07 '21 at 14:09
  • Awesome, I can confirm that the upgrade to `chromatic@5.5.1-dev.0` has fixed this for my local build. Many thanks! – Opentuned Jan 08 '21 at 17:43
  • 2
    Getting the same issue in latest (version 5.7.0) Running it via `./node_modules/.bin/chromatic --project-token=XXX` worked fine. This is my build-storybook.log when trying to install via npx `Starting: build-storybook -- --output-dir /var/folders/n5/wh9lxxj95dbg6nxntqzbx11m0000gn/T/chromatic--18123-7erHXFOO14gh node:internal/modules/cjs/loader:926 throw err; ^ Error: Cannot find module '/Users/braydencowell/Documents/ui-library/build-storybook' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:923:15) at Function.Module._load }` – Brayden C Mar 17 '21 at 18:05

1 Answers1

0

Upgrading to chromatic@5.5.1-dev.0 as per @Gert_Hengeveld comment has remedied the issue for build. Many thanks!

yarn chromatic
yarn run v1.22.5
$ npx chromatic --project-token ******

Chromatic CLI v5.5.1-dev.1
https://www.chromatic.com/docs/cli

✔ Authenticated with Chromatic
→ Using project token '**********'
✔ Retrieved git information
→ Commit '5aaa9bc' on branch 'CON-91-deploy-to-prod'; found 1 baseline commit
✔ Collected Storybook metadata
→ Storybook v6.1.3 for React; supported addons found: Actions, Backgrounds, Docs, Links, Viewport
✔ Storybook built in 1 minute 5 seconds
→ View build log at /Users/MEH/code/.../build-storybook.log
✔ Publish complete in 16 seconds
→ View your Storybook at https://5fc......0c1-mk...dy.chromatic.com
✔ Started build 7
→ View build details at https://www.chromatic.com/build?appId=5fc......0c1&number=7
✔ Build 7 failed after 10 seconds
Opentuned
  • 1,477
  • 17
  • 21