Skip to content

Remove all references to @mdx-js/react #80870

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

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

remcohaszing
Copy link
Contributor

What?

Remove all references to @mdx-js/react. One occurrence remains in the lockfile due to an indirect dependency.

Why?

@mdx-js/react is actively harmful for Next.js users. @mdx-js/react uses React context. React context can’t be used in server components. As a result, users who have @mdx-js/react inside their node_modules get confusing errors.

Removing @mdx-js/react from all documentation, tests, and optional peer dependencies, has no drawbacks. Removing @mdx-js/react as a next-mdx-import-source alias, fixes the confusing errors.

Users who insist on using @mdx-js/react, can still do this by explicitly specifying the providerImportSource option.

How?

Search for @mdx-js/react, and remove all occurences it.

`@mdx-js/react` is actively harmful for Next.js users. `@mdx-js/react`
uses React context. React context can’t be used in server components.
As a result, users who have `@mdx-js/react` inside their `node_modules`
get confusing errors.

Removing `@mdx-js/react` from all documentation, tests, and optional
peer dependencies, has no drawbacks. Removing `@mdx-js/react` as a
`next-mdx-import-source` alias, fixes the confusing errors.

Users who insist on using `@mdx-js/react`, can still do this by
explicitly specifying the `providerImportSource` option.
@ijjk ijjk added Documentation Related to Next.js' official documentation. examples Issue was opened via the examples template. tests Turbopack Related to Turbopack with Next.js. type: next labels Jun 24, 2025
@ijjk
Copy link
Member

ijjk commented Jun 24, 2025

Allow CI Workflow Run

  • approve CI run for commit: 09bedd6

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

Copy link

codspeed-hq bot commented Jun 24, 2025

CodSpeed Performance Report

Merging #80870 will create unknown performance changes

Comparing remcohaszing:remove-mdx-react (09bedd6) with canary (925fd91)

Summary

🆕 3 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 hmr_updates_large_20 N/A 16.9 µs N/A
🆕 hmr_updates_medium_10 N/A 17.5 µs N/A
🆕 hmr_updates_small_5 N/A 16 µs N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Related to Next.js' official documentation. examples Issue was opened via the examples template. tests Turbopack Related to Turbopack with Next.js. type: next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants