diff --git a/.changeset/stale-hats-notice.md b/.changeset/stale-hats-notice.md new file mode 100644 index 000000000..35431ab16 --- /dev/null +++ b/.changeset/stale-hats-notice.md @@ -0,0 +1,5 @@ +--- +'@web/storybook-builder': patch +--- + +fix Node 22.18 diff --git a/packages/storybook-builder/src/rollup-plugin-mdx.ts b/packages/storybook-builder/src/rollup-plugin-mdx.ts index a532285f2..124709789 100644 --- a/packages/storybook-builder/src/rollup-plugin-mdx.ts +++ b/packages/storybook-builder/src/rollup-plugin-mdx.ts @@ -1,4 +1,3 @@ -import { compile } from '@mdx-js/mdx'; import type { Options } from '@storybook/types'; import { readFile } from 'node:fs/promises'; import { dirname, join, sep } from 'node:path'; @@ -54,6 +53,7 @@ export function rollupPluginMdx(options: Options): Plugin { jsxOptions, }); + const { compile } = await import('@mdx-js/mdx'); // for CJS compatibility const mdxResult = await compile(mdxCode, mdxLoaderOptions.mdxCompileOptions); return mdxResult.toString();