Error reading test.stories.mdx with Storybook Docs
See original GitHub issueI am using Storybook 5.2.0-alpha.29, it is loading my storybook with:
loading presets
loading custom addons config
loading custom webpack config (full-control mode)
loading create-react-app config
My .storybook/config.js looks like this:
import {addParameters} from '@storybook/react';
import {create} from '@storybook/theming';
import '!style-loader!css-loader!sass-loader!../src/app.scss';
import {load} from '@storybook/react';
import {DocsPage} from '@storybook/addon-docs/blocks';
addParameters({
docs: DocsPage,
options: {theme: create({sometheme})}
});
load(require.context('../src/stories', true, /\.stories\.tsx?$/), module)
load(require.context('../src/stories', true, /\.stories\.mdx$/), module)
.storybook/presets.js looks like this:
module.exports =["@storybook/addon-docs/react/preset"];
.storybook/webpack.config.js looks like this:
const path = require('path');
module.exports = async({config}) => {
config.module.rules.push({
enforce: "pre",
test: /\.(ts|tsx)$/,
exclude: /node_modules/,
loader: "eslint-loader"
},{
test: /\.(ts|tsx)$/,
loader: "babel-loader",
exclude: /node_modules/,
options: {
presets: ['@babel/preset-react', '@babel/preset-typescript']
}
});
return config
};
then in my src/stories/test.stories.mdx I have the following:
import {Story, Meta} from '@storybook/addon-docs/blocks';
<Meta title="NewStory" />
<Story name="NewStory123">
<h2> Hello </h2>
</Story>
I am using React, TypeScript and @storybook@5.2.0-alpha.29
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
MDX - Storybook
Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and...
Read more >How to make a stories.mdx file in Storybook? - Stack Overflow
Try to do it this way: import { Story, Meta, Canvas } from "@storybook/components"; import Text from "."; <Meta title="MDX/Text" ...
Read more >Interaction tests • Chromatic docs
Go to your published Storybook to reproduce the exact state of your story when the test failed. Click the “View Storybook” button on...
Read more >Visual Testing with Storybook | Gatsby
Read more about it in the official documentation. TypeScript Support. Storybook v6 has out-of-the-box support for TypeScript. Your components and stories can be ......
Read more >@storybook/addon-docs - npm
MDX. If you want more control, MDX allows you to write long-form markdown documentation and stories in one file. You can also use...
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
Hey @rezaabedian Try using the following
presets.js
setup:Does that work for you?
Hey there, it’s me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!