MDX Table Not Rendering in Next.js App Router #77266
Replies: 7 comments 2 replies
-
I dig a lil bit on the issues and find this Dev server not working when using @next/mdx with plugins and --turbo and it's is closed without fixing? 🤯 |
Beta Was this translation helpful? Give feedback.
-
In my case the comment from @karlhorky on the issue above solved the issue. TLDR; next/mdx does not support tables by default, you have to use remark-gfm. Unfortunately remark and rehype plugins does not work with Turbopack when they are imported, so you have to define them "manually" like so:
|
Beta Was this translation helpful? Give feedback.
-
Any updates on this? |
Beta Was this translation helpful? Give feedback.
-
I got the same problem and I followed the same comment quoted by @kisszoltan and I obtained the same code, finally to make it work I had to remove this lines in nextConfig (it was enabling the Rust MDX loader / compiler or something):
|
Beta Was this translation helpful? Give feedback.
-
I've also encountered the same issue as reported above.
It would be nice to have the support for tables already within the above, and not through some other plugin... |
Beta Was this translation helpful? Give feedback.
-
In my case I have
However, the latest version of
Now it should be good. Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
Hey everyone, I saw this discussion and wanted to share that I've actually written a guide on how to tackle this very issue with Next.js, MDX, and tables on my blog. You can find a detailed solution in the following article: https://liupurnomo.com/next-mdx-table Hope this helps! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Hi everyone,
I'm using MDX with the App Router in Next.js and following the official documentation. However, my Markdown tables are not rendering correctly. Here’s an example of what I have in my .mdx file:
Instead of rendering as a table, it just appears as plain text in a
tag.
Setup Details:
Next.js version: 15.2.2
MDX library: @next/mdx 15.2.2
Rendering method: Using App Router (not Pages Router)
Does anyone know what might be causing this issue? Am I missing a configuration step?
Thanks in advance! 🙌
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions