chromaui/chromatic-cli

TurboSnap fails when .storybook/preview is TypeScript

Closed this issue · 5 comments

penx commented

If the storybook preview file is TypeScript (.storybook/preview.tsx), TurboSnap reports a file change when no modifications have been made:

⚠ TurboSnap disabled due to file change
[38](https://github.com/--/runs/--?check_suite_focus=true#step:6:38)
Found a Storybook config file change in packages/web-ds/.storybook/preview.tsx-generated-config-entry.js or its module sibling packages/web-ds/.storybook/preview.tsx
[39](https://github.com/--/runs/--?check_suite_focus=true#step:6:39)
A full build is required because this file cannot be linked to any specific stories.
[40](https://github.com/--/runs/--?check_suite_focus=true#step:6:40)

Using storybook@6.4.19, chromaui/action@v1, Chromatic CLI v6.5.4

Hey @penx -- what are the list of changed files in this case?

penx commented

@tmeasday thanks for getting back, I missed the notification last week!

Only packages/web-ds/.storybook/preview.tsx-generated-config-entry.js is mentioned in the logs. I'm not sure how I get a full list of files that TurboSnap thinks has changed other than what's in the log above, unless you mean what was changed in the PR?

In a monorepo, where a PR contains files in a completely independent package, we still get this message - so there are no files changed in the PR that should effect this. To work around this, for now I'm only running the action when there are changes to our design system package, but that still means we can't benefit from TurboSnap when there are changes.

I can try create a reproduction if it would help?

That's strange, thanks for reporting this @penx. TurboSnap should work in the monorepo situation you described.

Could you make a minimal reproduction for our team? 🙏 It'd be super helpful for debugging and writing tests against.

Oh, you might need to be running in CI mode or with the --debug flag for it to list the changed files it detects @penx

penx commented

This was on a project I no longer have access to, though I am on a different project where the preview is TypeScript and TurboSnap is working so closing this.