Unable to embed mdx/md documents within mdx doc page stories
See original GitHub issueDescribe the bug
An error is received when attempting to embed markdown documents within a doc page story (mdx file). Error states Failed to execute 'createElement' on 'Document': The tag name provided ('# Markdown File....
To Reproduce Steps to reproduce the behavior:
- Use below code along with a markdown file within story
- Navigate to story
- Open docs page
- View error
Expected behavior I would expect the content of the markdown file to be embedded within the mdx file content.
Screenshots If applicable, add screenshots to help explain your problem.
Code snippets Sample Content of my mdx file
import { moduleMetadata } from '@storybook/angular';
import { Story, Meta } from '@storybook/addon-docs/blocks';
import { MatCardModule } from '@angular/material/card';
import Overview from './docs/overview.md';
<Meta
title="Experience/Components"
decorators={
[
moduleMetadata(
{
imports: [
MatCardModule,
],
}
),
]
}
/>
<Overview />
<Story name="Card">
{{
template: `
<div style="padding: 10px">
<mat-card>Simple card</mat-card>
</div>
`,
}}
</Story>
Sample Content of my md file
# Markdown File
This is a markdown file...
System:
Environment Info:
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
Binaries:
Node: 10.15.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.16.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 41.16299.1004.0
"@storybook/addon-a11y": "5.2.0-beta.18",
"@storybook/addon-actions": "5.2.0-beta.18",
"@storybook/addon-docs": "5.2.0-beta.18",
"@storybook/addon-knobs": "5.2.0-beta.18",
"@storybook/addon-links": "5.2.0-beta.18",
"@storybook/addon-notes": "5.2.0-beta.18",
"@storybook/addon-viewport": "5.2.0-beta.18",
"@storybook/addons": "5.2.0-beta.18",
"@storybook/angular": "5.2.0-beta.18",
Issue Analytics
- State:
- Created 4 years ago
- Reactions:18
- Comments:35 (14 by maintainers)
Top Results From Across the Web
MDX - Storybook
Embedding stories. Suppose you have an existing story and want to embed it into your docs. Here's how to show a story with...
Read more >Getting started - MDX
This article explains how to integrate MDX into your project. It shows how to use MDX with your bundler and JSX runtime of...
Read more >gatsby-plugin-mdx
gatsby-plugin-mdx is the official integration for using MDX with Gatsby. MDX is markdown for the component era. It lets you write JSX embedded...
Read more >Blogging with Gatsby & MDX - React Training
We can't really get this effect with one file like pages/blog/index.js because anything we put in pages is a 1:1 mapping to a...
Read more >Not able to create documentation in MDX for Angular ...
So after a bit of searching I found something that works, at least my MDX doc is set up and I can see...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello there,
I was also stuck on this problem for a while, until I found something that works for me:
test.md
:test.stories.mdx
:I hope this is helps.
Not sure if you guys have successfully used this feature. What I did to get my MD files to be embeded, is by doing the followings:
Storybook version: 6.1.21
.storybook/main.js
I followed the example from here https://github.com/storybookjs/storybook/pull/11334/files