Storybook: Error reading test.stories.mdx with Storybook Docs

Created on 18 Jul 2019  路  5Comments  路  Source: storybookjs/storybook

I 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 createCompiler = require('@storybook/addon-docs/mdx-compiler-plugin);

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';

Hello


```

I am using React, TypeScript and @[email protected]

docs inactive question / support

Most helpful comment

Hey @rezaabedian Try using the following presets.js setup:

module.exports = [
  {
    name: "@storybook/addon-docs/react/preset",
    options: {
      configureJSX: true
    }
  }
];

Does that work for you?

All 5 comments

Thanks @rezaabedian! Will take a look in the next hr! 馃檹

Thanks @rezaabedian! Will take a look in the next hr! 馃檹

Thank you! I was previously getting the error to do with mdx-loader and the not being closed, but that message has gone away. Now all I get is storybook loading up with no console errors, but also "No Docs Found" and with no stories on the left nav.

Hey @rezaabedian Try using the following presets.js setup:

module.exports = [
  {
    name: "@storybook/addon-docs/react/preset",
    options: {
      configureJSX: true
    }
  }
];

Does that work for you?

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

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!

Was this page helpful?
0 / 5 - 0 ratings