Open LunaticMuch opened 11 months ago
Make sure you have mdx-components.tsx
file at the root of your poject.
I also encountered the same problem, this was my solution, I once thought if I had configured it wrong!
Had the same issue, specifically mdx-components.tsx
needs to be inside the root
directory, NOT root/app
like in your example: https://github.com/LunaticMuch/redesigned-octo-fortnight/blob/main/app/mdx-components.tsx
I wish the documentation made this more clear, or the error called out that it couldn't find mdx-components.tsx
in the appropriate file location.
Make sure you have mdx-components.tsx file at the root of your poject.
The problem persists, even though I have mdx-components.tsx
at root of app
directory, the error remains unchanged.
The problem persists, even though I have
mdx-components.tsx
at root ofapp
directory, the error remains unchanged.
See my previous comment, mdx-components.tsx
should not be in the /app
directory.
See my previous comment,
mdx-components.tsx
should not be in the/app
directory.
Tested: 9/22/2024.
Result: Success
Added mdx-components.tsx file which contains:
import type { MDXComponents } from "mdx/types";
export function useMDXComponents(components: MDXComponents): MDXComponents {
return {
...components,
};
}
Note: Make sure to restart the server once it's added.
Link to the code that reproduces this issue
https://github.com/LunaticMuch/redesigned-octo-fortnight
To Reproduce
[manual](https://nextjs.org/docs/app/building-your-application/configuring/mdx)
for installing MDXnpm run dev
Current vs. Expected behavior
You would expect to see the mdx page, instead
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
MDX (@next/mdx)
Additional context
I just did a simple test following the manual.