-
Notifications
You must be signed in to change notification settings - Fork 36
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
[Bug]: Creating stories from Controls fails in Svelte CSF with SyntaxError: Unexpected token, expected "}"
#240
Comments
hopefully sveltejs/esrap#13 will address that |
Same problem. |
This affects the Storybook 7 to 8 migration tool as well. |
@nathancahill Can you please give us more context?
In this issue, we're talking about attempting to click "Save", after playing around with controls in the Storybook UI. I can't see a connection with a migration tool. |
The underlying transformation error is the same in both. Running the |
@nathancahill it's a pretty common error that can show up in a lot of different places, the two problems are not related. |
Describe the bug
When viewing a story written in Svelte CSF, editing controls and pressing "Save", the UI shows
did not save, unknown error
, and the terminal shows an error.This is because the editing logic of controls doesn't support Svelte CSF, only regular CSF, which is a completely different format, language even.
Steps to reproduce the behavior
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots and/or logs
Error in terminal:
Additional context
At the moment it's not feasible to implement Svelte CSF support in Create from Controls. The feature works by modifying the AST, and given it's a completely different AST, the logic would have to be completely different. It might even be impossible at the current stage, given the only tool that allows you to print a Svelte AST to source is
svelte-ast-print
which lacks features such as TypeScript support.We should instead disable the feature from the addon. That is done by setting a specific parameter, and the addon can set that parameter for all stories it touches, so it wouldn't affect stories written in regular CSF:
https://storybook.js.org/docs/essentials/controls#disablesavefromui
Originally reported at sveltejs/cli#339
The text was updated successfully, but these errors were encountered: