You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey Guys,
MDXRemote does not work on Next.JS 14 with app-based routing. Have you tested it? I saw someone said she imported MDXRemote 'next-mdx-remote/rsc", but that doesn't make sense, not sure what she did.
const mdxSource = await serialize(content, {
scope: {},
mdxOptions: {
rehypePlugins: [rehypeCodeTitles, rehypeKatex], //Looks like rehypePrism is not working with next js 14!!!
remarkPlugins: [remarkMath, remarkGfm],
},
parseFrontmatter: true,
});
...
<MDXRemote
{...mdxSource}
components={components}
/>
`
next-mdx-remote version
v5
The text was updated successfully, but these errors were encountered:
I can confirm that this package is no longer working with rehypeKatex and probably other plugins. Previously simple formula like: x = \frac{1}{\sqrt{2}} where being compiled without any problem but now it results in this error:
An error occurred!
[next-mdx-remote] error compiling MDX: Could not parse expression with acorn More information: https://mdxjs.com/docs/troubleshooting-mdx
Describe the bug
Hey Guys,
MDXRemote does not work on Next.JS 14 with app-based routing. Have you tested it? I saw someone said she imported MDXRemote 'next-mdx-remote/rsc", but that doesn't make sense, not sure what she did.
Thanks for the help
Reproduction
`.
const BlogPost = async ({
params,
}: {
params: { slug: string; category_or_slug: string };
}) => {
const post = await getPost(params.category_or_slug, params.slug);
if (!post) return notFound();
const {
subject,
content,
createdAt,
authors,
tags,
postCategories,
relevantPosts,
} = post;
const mdxSource = await serialize(content, {
scope: {},
mdxOptions: {
rehypePlugins: [rehypeCodeTitles, rehypeKatex], //Looks like rehypePrism is not working with next js 14!!!
remarkPlugins: [remarkMath, remarkGfm],
},
parseFrontmatter: true,
});
...
<MDXRemote
{...mdxSource}
`
next-mdx-remote version
v5
The text was updated successfully, but these errors were encountered: