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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version issue of mdx-js/react, rehyle-katex, remark-math #2

Open
milkcoke opened this issue Feb 17, 2023 · 0 comments
Open

Version issue of mdx-js/react, rehyle-katex, remark-math #2

milkcoke opened this issue Feb 17, 2023 · 0 comments
Assignees

Comments

@milkcoke
Copy link
Owner

milkcoke commented Feb 17, 2023

馃敀 Problem

Next 3 libraries latest version doesn't work with docusaurus.

Library Old version New version
@mdx-js-react 1.6.22 2.3.0
rehype-katex 5 6
remark-math 3 5

@mdx-js-react

latest version occurs error as shown below

(0 , _mdx_js_react__WEBPACK_IMPORTED_MODULE_2__.mdx) is not a function

rehyle-katex, remark-math

Error

[ERROR] Error [ERR_REQUIRE_ESM]: require() of ES Module[USER-PATH]\node_modules\remark-math\index.js from [USER-PATH]\docusaurus.config.js not supported.
Instead change the require of index.js in [USER-PATH]\docusaurus\docusaurus.config.js to a dynamic import() which is available in all CommonJS modules.

Cause

Currently, docusaurus must use rehyle-katex@5 and remark-math@3 since those are only supporting ESM but docusaurus doesn't do it.

Use the exact same versions. The latest versions are incompatible with Docusaurus 2. - docusaurus document

Docusaurus has built-in support for MDX v1, which allows you to write JSX within your Markdown files and render them as React components. - docusaurus document

馃攽 Solution

Use old version and wait until docusaurus or those support compatibility either.

馃敆 Reference

@milkcoke milkcoke self-assigned this Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant