Open gbkwiatt opened 2 years ago
I know you and I talked about this yesterday, but I'm actually unable to reproduce this in v7.0.0-alpha.45
.
Adding {hello}
to an mdx
file will cause the doc to not render at all, but the build will work fine and produce an iframe.html
Adding {[key: string]: string}
like I know you tried will make both dev and the build fail explicitly with a syntax error like
ERR! [12:6: Could not parse expression with acorn: Unexpected token] {
ERR! reason: 'Could not parse expression with acorn: Unexpected token',
ERR! line: 12,
ERR! column: 6,
ERR! source: 'micromark-extension-mdx-expression',
ERR! ruleId: 'acorn',
ERR! position: {
ERR! start: { line: 12, column: 6, offset: 437 },
ERR! end: { line: null, column: null }
ERR! }
ERR! }
The reason these two lines don't work is that MDX2 parses {...}
as JavaScript, so {hello}
will result in "hello is undefined" while {[key: string]: string}
will result in an unexpected token.
Describe the bug
In my case there was an issue with
*.md
being treated as mdx, so anything with{ }
and without backtick, was failing withCould not parse expression with acorn: Unexpected token
However whole build was not failing and completing with success. But as a result there was missing files in
storybook-static
output dir. ( missingiframe.html
)You can see those errors in logs from build, but it's very easy to miss, especially that build does not report error at all.
To Reproduce
System
No response
Additional context
No response