Skip to content

MDX v2 not working #44

@DCsunset

Description

@DCsunset

Hello,

If I install the @mdx-js/mdx package and follow the instructions in README.md, everything works well.

However, if I use the @mdx-js/mdx@next package, an error would occur:

error when starting dev server:
Error [ERR_REQUIRE_ESM]: require() of ES Module <project>/node_modules/@mdx-js/mdx/index.js from <project>/node_modules/vite-plugin-mdx/dist/imports.js not supported.
Instead change the require of index.js in <project>/node_modules/vite-plugin-mdx/dist/imports.js to a dynamic import() which is available in all CommonJS modules.
    at Object.requireMdx (<project>/node_modules/vite-plugin-mdx/dist/imports.js:10:12)
    at Object.createTransformer (<project>/node_modules/vite-plugin-mdx/dist/transform.js:16:27)
    at Object.configResolved (<project>/node_modules/vite-plugin-mdx/dist/index.js:46:43)
    at <project>/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:68353:127
    at Array.map (<anonymous>)
    at resolveConfig (<project>/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:68353:35)
    at async createServer (<project>/node_modules/vite/dist/node/chunks/dep-e0fe87f8.js:66702:20)
    at async CAC.<anonymous> (<project>/node_modules/vite/dist/node/cli.js:687:24)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions