chromaui/chromatic-cli

Warn user about missing `preview-stats.json` when running with `--only-changed`

Closed this issue · 1 comments

Feature request

It would be great if the CLI could show a warning or error when running with --only-changed and the built storybook doesn't have the preview-stats.json.

We ran into a situation where we didn't notice for a while that our TurboSnap wasn't working anymore on our project. We recently migrated our Storybook from using webpack to using vite, and since TurboSnap was set up way before that, and because of that it wasn't obvious to us that we needed to add vite-plugin-turbosnap to make it work again.

Since to me it sounds like TurboSnap only works with preview-stats.json anyways (it's even mentioned in the tooltip in chromatic, but no one from our team saw that early enough), it would be great to get feedback on this as early as possible, ideally from the CLI. Does this make sense?

Edit:
Looks like the CLI actually prints a warning, but no one of our team has perceived this.
CleanShot 2023-12-05 at 13 41 35
It's easy to miss since it looks visually very much like the warning when TurboSnap is disabled due to rebuild.
Screenshot 2023-12-05 at 13 29 31

So I think it would be best if the command just fails in this case altogether, what do you think?

This was fixed in a recent release