-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Addon-Docs: Newlines in HTML MDX <Story> gives compile error #7902
Comments
👍 , was just about to report this as well. |
Would you mind including the error output in the issue description? |
Related: mdx-js/mdx#767 |
Here's an example and error message. Unfortunately, it's upstream like you noted in the link. I've hit it about a dozen different ways while trying to use MDX stories, as it's a significant-whitespace issue, and both Example:
Error:
|
why was tis issue removed from 5.3.x milestone? and why is it not in the next milestone? |
@dellfort this issue was remove from 5.3.x because we're done with 5.3 except for high priority security fixes. Time to upgrade to 6.0: We're waiting for MDX 2.0, which will hopefully fix a bunch of issues on that side of things. |
Reporting it's been almost over a year (since last comment) and this bug is still occurring I've just spent some time not understand why my simple MDX story broke: <Canvas>
<Story name="Warning" args={{ title: 'Lorem ipsum dolor', children: 'Lorem ipsum dolor' }}>
{Template.bind({})}
</Story>
<Story name="Error" args={{ children: 'Lorem ipsum dolor' }}>
{Template.bind({})}
</Story>
<Story name="Success" args={{ children: 'Lorem ipsum dolor' }}>
{Template.bind({})}
</Story>
</Canvas> It was caused from the new lines between each |
Can you confirm if this issue affects whitespace in code blocks as well? e.g. const foo = 'hello'
const bar = 1 |
@shilman MDX 2.0 is in an rc stage now. Are you waiting until it is stable? |
@micDropper it's a breaking change, so i'm waiting until SB 7.0 to release it. However, I will try to get a prototype working ASAP so I can figure out:
|
Having this issue as well. Even the docs are wrong as they have newlines in them which result in a syntax error. |
@andrewplummer Which example code is failing for you? |
This specifically: <Canvas>
<Story
name="warning"
args={{
status: 'warning',
label: 'Warning',
}}>
{Template.bind({})}
</Story>
<Story
name="neutral"
args={{
status: 'neutral',
label: 'Neutral',
}}>
{Template.bind({})}
</Story>
<Story
name="error"
args={{
status: 'error',
label: 'Error',
}}>
{Template.bind({})}
</Story>
</Canvas> |
6.4.9 still this issue. When I add new lines in the jsx block scope I get syntax error. I am new to storybook and I spent whole day trying to figure out what I am doing wrong until I realized that every space and new line matters. It is very frustrating. Is there a way I can fix it before MDX 2.0 is ready? |
@AdrianGolda MDXv2 is in RC. hopefully we can get it incorporated soon! |
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 |
Hi @shilman, I was reading in another place where you wrote that Storybook v7 will be released next month with MDXv2 support so I was just waiting for it to ship... is that information correct? |
@yairEO where did you read that? SB6.5 will be released next month. SB7 release date is TBD. |
@shilman - I don't remember where i've read this... sorry. was about ~2 weeks ago. Anyway I really admire your hard work here and obvious dedication and positive attitude and want to thank you deeply, as a devoted Storybook user for many years. |
Thanks @yairEO -- I appreciate the kind words! 🙏 |
Does this issue resolved ? |
You need MDX v2, which will only be available in storybook v7. |
Oh I see , thanks you |
We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if:
FWIW we have fully upgraded to MDX2 in 7.0 |
Describe the bug
When newlines are present in a MDX story you get a compilation error.
This works:
This does not:
System:
The text was updated successfully, but these errors were encountered: