chromatic-cli icon indicating copy to clipboard operation
chromatic-cli copied to clipboard

TurboSnap fails when .storybook/preview is TypeScript

Open penx opened this issue 3 years ago • 4 comments

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 [email protected], chromaui/action@v1, Chromatic CLI v6.5.4

penx avatar May 05 '22 12:05 penx

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

tmeasday avatar May 06 '22 00:05 tmeasday

@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?

penx avatar May 13 '22 09:05 penx

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.

domyen avatar May 13 '22 14:05 domyen

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

tmeasday avatar May 15 '22 23:05 tmeasday

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.

penx avatar Feb 24 '23 11:02 penx