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

If chromatic.config.json has storybookBuildDir configured, a build is not triggered #323

Closed
rhuanbarreto opened this issue Jun 24, 2024 · 2 comments · Fixed by #324
Closed
Assignees

Comments

@rhuanbarreto
Copy link

Describe the bug

I separately build the storybook for caching purposes in CI so we speed up the process in our monorepo. And for this I use the storybookBuildDir option in the chromatic.config.json file.

But when I push the play button in the storybook interface, the chromatic command fails:

Invalid Storybook build at storybook-static: ENOENT: no such file or directory, scandir 'storybook-static'

This is because in development, the developers don't build the storybook locally, which is fine.

I understand that the addon just delegates the build responsibility to the chromatic command. But could either the addon or the chromatic command trigger a build if there's nothing on the storybookBuildDir?

To reproduce

  1. Setup chromatic.config.json with storybookBuildDir
  2. Remove the storybookBuildDir folder if there's any
  3. Start the storybook: storybook dev -p 6006
  4. Push the play button to trigger the visual tests addon
  5. The underlying chromatic command should fail

Environment

"@chromatic-com/storybook": "1.5.0",
"@storybook/addon-designs": "8.0.2",
"@storybook/addon-essentials": "8.1.1",
"@storybook/addon-interactions": "8.1.1",
"@storybook/addon-themes": "8.1.1",
"@storybook/react": "8.1.1",
"@storybook/react-vite": "8.1.1",
@ghengeveld ghengeveld self-assigned this Jun 25, 2024
@ghengeveld ghengeveld linked a pull request Jun 25, 2024 that will close this issue
@rhuanbarreto
Copy link
Author

Thanks a lot for fixing this!

@ghengeveld
Copy link
Member

No problem, thanks for reporting.

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

Successfully merging a pull request may close this issue.

2 participants