You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error didn't happen if I place the img tag after some markdown heading, for example:
import { Meta } from '@storybook/addon-docs/blocks';
<Meta title="Introduction|Getting Started" />
# Getting Started
<img src="/image.jpeg" height="250" alt="images" />
Welcome to the storybook sandbox. This is not error.
But, this become error.
import { Meta } from '@storybook/addon-docs/blocks';
<Meta title="Introduction|Getting Started" />
<img src="/image.jpeg" height="250" alt="images" />
# Getting Started
Welcome to the storybook sandbox. This is not error.
Run start-storybook with static-dir is public. (Image is located inside public directory).
See error
Expected behavior
Image should be shown properly.
Screenshots
ERROR in ./src/introduction.stories.mdx
Module build failed (from ./node_modules/@mdx-js/loader/index.js):
SyntaxError: Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>? (2:0)
at Object.raise (/home/jeffryangtoni/sources/personal/github/sandbox/javascript-typescript/storybook-addon-docs-repro/node_modules/@babel/parser/lib/index.js:6975:17)
at Object.jsxParseElementAt (/home/jeffryangtoni/sources/personal/github/sandbox/javascript-typescript/storybook-addon-docs-repro/node_modules/@babel/parser/lib/index.js:4075:18)
at Object.jsxParseElement (/home/jeffryangtoni/sources/personal/github/sandbox/javascript-typescript/storybook-addon-docs-repro/node_modules/@babel/parser/lib/index.js:4085:17)
at Object.parseExprAtom (/home/jeffryangtoni/sources/personal/github/sandbox/javascript-typescript/storybook-addon-docs-repro/node_modules/@babel/parser/lib/index.js:4092:19)
at Object.parseExprSubscripts (/home/jeffryangtoni/sources/personal/github/sandbox/javascript-typescript/storybook-addon-docs-repro/node_modules/@babel/parser/lib/index.js:9210:23)
at Object.parseMaybeUnary (/home/jeffryangtoni/sources/personal/github/sandbox/javascript-typescript/storybook-addon-docs-repro/node_modules/@babel/parser/lib/index.js:9190:21)
at Object.parseExprOps (/home/jeffryangtoni/sources/personal/github/sandbox/javascript-typescript/storybook-addon-docs-repro/node_modules/@babel/parser/lib/index.js:9056:23)
at Object.parseMaybeConditional (/home/jeffryangtoni/sources/personal/github/sandbox/javascript-typescript/storybook-addon-docs-repro/node_modules/@babel/parser/lib/index.js:9029:23)
at Object.parseMaybeAssign (/home/jeffryangtoni/sources/personal/github/sandbox/javascript-typescript/storybook-addon-docs-repro/node_modules/@babel/parser/lib/index.js:8975:21)
at Object.parseExpression (/home/jeffryangtoni/sources/personal/github/sandbox/javascript-typescript/storybook-addon-docs-repro/node_modules/@babel/parser/lib/index.js:8925:23)
at Object.getExpression (/home/jeffryangtoni/sources/personal/github/sandbox/javascript-typescript/storybook-addon-docs-repro/node_modules/@babel/parser/lib/index.js:8911:23)
at Object.parseExpression (/home/jeffryangtoni/sources/personal/github/sandbox/javascript-typescript/storybook-addon-docs-repro/node_modules/@babel/parser/lib/index.js:12158:17)
at getExports (/home/jeffryangtoni/sources/personal/github/sandbox/javascript-typescript/storybook-addon-docs-repro/node_modules/@storybook/addon-docs/dist/mdx/mdx-compiler-plugin.js:267:26)
at /home/jeffryangtoni/sources/personal/github/sandbox/javascript-typescript/storybook-addon-docs-repro/node_modules/@storybook/addon-docs/dist/mdx/mdx-compiler-plugin.js:314:19
at Array.forEach (<anonymous>)
at extractExports (/home/jeffryangtoni/sources/personal/github/sandbox/javascript-typescript/storybook-addon-docs-repro/node_modules/@storybook/addon-docs/dist/mdx/mdx-compiler-plugin.js:313:17)
@ ./.storybook/config.ts 12:28-70
@ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/config.ts (webpack)-hot-middleware/client.js?reload=true&quiet=true
Describe the bug
Got
SyntaxError: Adjacent JSX elements must be wrapped in an enclosing tag.
when inserting<img>
element below<Meta>
(I followed the example from https://github.com/chromaui/learnstorybook-design-system/blob/master/src/Intro.stories.mdx)The error didn't happen if I place the
img
tag after some markdown heading, for example:But, this become error.
To Reproduce
Steps to reproduce the behavior:
introduction.stories.tsx
insidesrc
directory.<Meta>
and<img>
tags sequentially (after ).public
. (Image is located inside public directory).Expected behavior
Image should be shown properly.
Screenshots
Code snippets
You can see it inside my sandbox-repo: https://github.com/jeffryang24/sandbox/tree/master/javascript-typescript/storybook-addon-docs-repro.
System:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: