Files
vercel__next.js/packages/next-mdx/mdx-components.js
Remco Haszing 62fa7fa16d Add a fallback for the mdx-components file (#59693)
### What?

Provide a fallback for the `mdx-components` file.

### Why?

Given a user uses the Next.js app directory, and doesn’t have an
`mdx-components` file;
1. If the user has `@mdx-js/react` installed, Next.js shows a cryptic
error message, stating only client components may use React context.
2. If the user doesn’t have `@mdx-js/react` installed, Next.js shows a
cryptic error message, stating `next-mdx-import-source-file` could not
be resolved.

### How?

This fixes 2 by providing a fallback.

I suggest fixing 1, by completely removing all references to
`@mdx-js/react` from the project.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2025-06-23 18:49:03 -07:00

6 lines
89 B
JavaScript

function useMDXComponents() {
return {}
}
exports.useMDXComponents = useMDXComponents