question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MDX integration causes build error

See original GitHub issue

Description

When following the Documentation steps in Design Systems for Developers, I came across a build error with @babel/parser when I changed the config to import the new mdx file Avatar.stories.mdx

Via the instructions here, adding babel-loader as a dev dependency seems to solve the issue. Not sure if this is 100% needed but I wasn’t able to get it working without it.

Error

Screen Shot 2019-10-07 at 2 50 44 PM

Proposed Change

Add yarn add -D babel-loader as a step when integrating MDX.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
grahamcrackerscommented, Oct 15, 2019

I was going through this tutorial last night and I just wanted to confirm that adding the following snippet did allow mdx to work for me.

module.exports = [
  {
    name: '@storybook/addon-docs/react/preset',
    options: {
      configureJSX: true,
    },
  },
];
3reactions
horaciohcommented, Oct 15, 2019

the problem here is solved if you set some options on .storybook/presets.js file: https://github.com/storybookjs/storybook/blob/master/addons/docs/README.md#preset-options

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

working on a PR to add this to the docs 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting MDX
This article goes through several common problems and errors that might occur when using MDX.
Read more >
CREATE MEMBER Statement (MDX) - SQL Server
The CREATE MEMBER statement creates a calculated member with session scope. Scope Isolation. When a cube Multidimensional Expressions (MDX) ...
Read more >
Create a Next.js and MDX blog - LogRocket Blog
The v2 release of MDX makes it possible to write expressions in MDX, ... Their compilers (integrations from MDX) compile both MDX files ......
Read more >
gatsby-plugin-mdx - npm
MDX integration for Gatsby. Latest version: 5.3.1, last published: 8 days ago. Start using gatsby-plugin-mdx in your project by running `npm ...
Read more >
gatsby-mdx-fix
Logo gatsby-mdx-fix is the official integration for using MDX with Gatsby. ... By default, this configuration will allow you to create pages with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found