-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Better compilation errors for MDX stories #12780
Comments
This is an error from the MDX compiler, not from Storybook. Hopefully we can get better errors when v2 is released (mdx-js/mdx#1041), or even better yet, the MDX parser becomes more resilient to errors. Will definitely circle back on this. |
FWIW - I find w/ mdx many of those obtuse errors are just caused by an extra line break. I installed an MDX plugin for VSCode which helped to show the extra line breaks causing it to not be recognized as valid syntax. |
Great tip @agrohs! ❤️ |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
I just had a very weird debugging experience and would like to share it here. This is the start of my file
This yielded the warning
and the according story Thanks to comment #12780 (comment) by @agrohs I tried removing the empty line between my two It is strange though that if there is something in that line, e. g. a blank space, it doesn't fail. But it reproducible in the MDX playground even. https://mdxjs.com/playground/ If that is something everybody else working with MDX knows, we are fine. If not, maybe Storybook can somehow help to improve the experience here. |
@marians we are waiting for MDXv2 to re-address this mdx-js/mdx#1041 |
Hey gang! A lot of you have been waiting a long time for MDXv2. I've released experimental support in Storybook 6.5 and would love your help to kick the tires. I've written up a short guide here and will update it with the latest as it stabilizes: https://gist.github.com/shilman/6ff2d7e18db8846e8fc552fb432ae4f6 |
In storybook 7.0 beta the MDX2 is the new default, I'm closing this issue. |
Is your feature request related to a problem? Please describe
It's very frustrating debugging compilation errors in mdx stories.
For example, here is a story im working on:
and here is the error im getting:
It's not very informative. Line 16 is the
<canvas>
element, and it's basically telling me there is an error somewhere between line 16-83.Describe the solution you'd like
a better error log saying exactly the line where the mdx is broken.
Describe alternatives you've considered
The only debug workflow i have right now is to delete blocks of code one by one until i find the one that is broken (a method thats not even working for this particular snippet).
Are you able to assist to bring the feature to reality?
no. I don't think I have the skillz.
Keep up the great work!
The text was updated successfully, but these errors were encountered: