Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to load MDX in v6.5.8 #19180

Closed
brendonco opened this issue Sep 14, 2022 · 1 comment
Closed

Not able to load MDX in v6.5.8 #19180

brendonco opened this issue Sep 14, 2022 · 1 comment

Comments

@brendonco
Copy link

Not able to load MDX file in v6.5.8

To Reproduce

file.stories.mdx

import { Meta } from '@storybook/addon-docs/blocks';
import Changelog from './CHANGELOG.md';

<Meta title='Releases/CHANGELOG' />

<Changelog />

main.js

module.exports = {
  features: {
    storyStoreV7: true,
    babelModeV7: true,
    previewMdx2: true,
  },
  core: {
    builder: 'webpack5',
    disableTelemetry: true, // 👈 Disables telemetry
  },
  babel: async (options) => {
    options.plugins.push('babel-plugin-inline-react-svg');
    return options;
  },
  stories: ['../stories/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
  addons: [
    '@storybook/addon-links',
    '@storybook/addon-actions',
    '@storybook/addon-viewport',
    {
      name: '@storybook/addon-docs',
      options: {
        configureJSX: true,
        babelOptions: {},
        sourceLoaderOptions: null,
        transcludeMarkdown: true,
      },
    },
    '@storybook/addon-controls',
    '@storybook/addon-backgrounds',
    '@storybook/addon-toolbars',
    '@storybook/addon-measure',
    '@storybook/addon-outline',
  ],
  framework: '@storybook/react',
};

System
Please paste the results of npx sb@next info here.

Environment Info:

  System:
    OS: Windows 10 10.0.19042
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz
  Binaries:
    Node: 16.14.2 - ~\SoftwaresInstalled\node-v16.14.2-win-x64\node.EXE
    npm: 8.5.0 - ~\SoftwaresInstalled\node-v16.14.2-win-x64\npm.CMD
  Browsers:
    Chrome: 103.0.5060.114
    Edge: Spartan (44.19041.1266.0), Chromium (103.0.1264.49)
  npmPackages:
    @storybook/addon-actions: ^6.5.9 => 6.5.10
    @storybook/addon-backgrounds: ^6.5.12 => 6.5.12
    @storybook/addon-controls: ^6.5.12 => 6.5.12
    @storybook/addon-docs: ^6.5.10 => 6.5.10
    @storybook/addon-essentials: ^6.5.9 => 6.5.10
    @storybook/addon-links: ^6.5.9 => 6.5.10
    @storybook/addon-measure: ^6.5.12 => 6.5.12
    @storybook/addon-outline: ^6.5.12 => 6.5.12
    @storybook/addon-postcss: ^2.0.0 => 2.0.0
    @storybook/addon-storyshots: ^6.5.9 => 6.5.10
    @storybook/addon-storysource: ^6.5.9 => 6.5.10
    @storybook/addon-toolbars: ^6.5.12 => 6.5.12
    @storybook/addon-viewport: ^6.5.12 => 6.5.12
    @storybook/addons: ^6.5.9 => 6.5.10
    @storybook/builder-webpack5: ^6.5.9 => 6.5.10
    @storybook/manager-webpack5: ^6.5.9 => 6.5.10
    @storybook/react: ^6.5.9 => 6.5.10
    @storybook/react-docgen-typescript-plugin: ^1.0.1 => 1.0.1
    @storybook/theming: ^6.5.9 => 6.5.10

Error

ModuleBuildError: Module build failed (from ./node_modules/@storybook/mdx2-csf/loader.js):
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".json" for \node_modules\character-entities-legacy\index.json
    at new NodeError (node:internal/errors:371:5)
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:87:11)
    at defaultGetFormat (node:internal/modules/esm/get_format:102:38)
    at defaultLoad (node:internal/modules/esm/load:21:14)
    at ESMLoader.load (node:internal/modules/esm/loader:359:26)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:280:58)
    at new ModuleJob (node:internal/modules/esm/module_job:66:26)
    at ESMLoader.#createModuleJob (node:internal/modules/esm/loader:297:17)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:261:34)
    at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:81:21)
    at processResult (\node_modules\webpack\lib\NormalModule.js:758:19)
    at \node_modules\webpack\lib\NormalModule.js:860:5
    at \node_modules\loader-runner\lib\LoaderRunner.js:400:11
    at \node_modules\loader-runner\lib\LoaderRunner.js:252:18
    at context.callback \node_modules\loader-runner\lib\LoaderRunner.js:124:13)
    at Object.loader (\node_modules\@storybook\mdx2-csf\loader.js:26:12)

WARN Broken build, fix the error above.
WARN You may need to refresh the browser.
@vanessayuenn
Copy link
Contributor

In attempt to clean up old issue, I will be closing this one. We've made lots of improvements in Storybook since 7.0 so it's quite likely that this issue has been resolved already. If this is still a problem, please open a new issue with reproduction steps for 7.x version. Thank you!

@vanessayuenn vanessayuenn closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants