-
Notifications
You must be signed in to change notification settings - Fork 79
Description
mdx-bundlerversion: 10.0.0nodeversion: 18.18.2npmversion: 9.8.1
Relevant code or config
Not applicable / see repro.
What you did:
I have working code [email protected]
When we upgrade to [email protected] it errors.
What happened:
/Users/davidjohnston/git-workspace/example-remix-app/node_modules/mdx-bundler/dist/index.js:11
var _remarkMdxFrontmatter = _interopRequireDefault(require("remark-mdx-frontmatter"));
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/davidjohnston/git-workspace/example-remix-app/node_modules/mdx-bundler/node_modules/remark-mdx-frontmatter/index.js from /Users/davidjohnston/git-workspace/example-remix-app/node_modules/mdx-bundler/dist/index.js not supported.
Instead change the require of /Users/davidjohnston/git-workspace/example-remix-app/node_modules/mdx-bundler/node_modules/remark-mdx-frontmatter/index.js in /Users/davidjohnston/git-workspace/example-remix-app/node_modules/mdx-bundler/dist/index.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/Users/davidjohnston/git-workspace/example-remix-app/node_modules/mdx-bundler/dist/index.js:11:52)
Reproduction repository:
This commit has a basic [email protected] application with [email protected] working.
dwjohnston/example-remix-app@193bd84
Run
npm i
npm run dev
Navigate to any of the links to see some MDX being rendered fine.
This commit dwjohnston/example-remix-app@359efc5
Just upgrades mdx-bundler to 10.0.0.
When we run npm run dev we now get the [ERR_REQUIRE_ESM].
Problem description:
The problem appears to be that [email protected] publishes its packages as an ESM module and mdx-bundler@10 still requires this.
Suggested solution:
Not sure. Is this actually a bug with [email protected]?
Workaround
Downgrade to 9.2.1