next markdown rendering library (NOT MDX) on server

So, I'm making a Q&A and users can ask questions and add markdown to their questions. I was using next-mdx-remote to render it, but if user adds any <Component /> to their markdown, it will throw an error when rendering it: Error: Expected component Comp to be defined: you likely forgot to import, pass, or provide it. Is there a way to turn off mdx in next-mdx-remote, or are there any other libraries to render it on server. This is exhausting, ngl 😦
Solution:
yo, I used react-markdown, and it works fine with SSR and RSC. So I guess just use react-markdown now, to avoid errors with JSX in markdown
Jump to solution
6 Replies
barry
barry•12mo ago
Configuring: MDX | Next.js
Learn how to configure MDX to write JSX in your markdown files.
barry
barry•12mo ago
Make your own little parser
Rezix
Rezix•12mo ago
Did something similiar 4 days ago 😄 https://github.com/programowanienakolanie/poradnik-css-pl/
GitHub
GitHub - programowanienakolanie/poradnik-css-pl: Krótki Poradnik CS...
Krótki Poradnik CSS po Polsku. Contribute to programowanienakolanie/poradnik-css-pl development by creating an account on GitHub.
Rezix
Rezix•12mo ago
Used the same approach as @barry described
Josh
Josh•12mo ago
your looking for unified
Solution
iboughtbed
iboughtbed•12mo ago
yo, I used react-markdown, and it works fine with SSR and RSC. So I guess just use react-markdown now, to avoid errors with JSX in markdown
Want results from more Discord servers?
Add your server