-
Hello, there. Briefly, I have an editor that builds an MDX file composed of components like blocks. I'm using 2 "different" libraries to render my mdx at different times, when editing I use evaluate from @mdx-js/mdx(only to show a preview on client-side) and when generating static pages I use next-mdx- remote. The MDX that is generated by the editor looks like this: When I use an evaluate here it works, as a "props" property is expected. But when I try to generate static pages from that same MDX with next-mdx-remote, it breaks when I pass the "props" property, since it was not expecting such a property like evalute. And this is the MDX that works on MDX remote: The only solution I found was to convert the MDX file to string and rename everything that is "props" to "frontmatter" in it, but that doesn't smell right. That's why I came here to ask for a direction. I would like to know if the same MDX file could be valid for this 2 methods in this 2 libraries, or if it is possible to configure such a thing? Am I missing something? Here is a reproduction, stringMDX has to be different: Relevant Information: Relevante Libs: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I am not sure. I don’t maintain There are some weird things going on in your example. For example, your MDX file contains frontmatter. But that frontmatter isn’t used. So I think it is logical to conclude that if you pass different props to different libraries, they will do different things.
What is your actual problem? What is your actual question? What do you want to do? |
Beta Was this translation helpful? Give feedback.
I am not sure. I don’t maintain
next-mdx-remote
. That being said, I think one can assume that there are differences.There are some weird things going on in your example. For example, your MDX file contains frontmatter. But that frontmatter isn’t used.
You instead pass props that look very similar to
evaluate
: https://github.com/marissync/mdx-poc/blob/9aeeb3aab40234cbd5d063e96e344f0439ac96bf/pages/evaluate-test.tsx#L28, https://github.com/marissync/mdx-poc/blob/9aeeb3aab40234cbd5d063e96e344f0439ac96bf/pages/evaluate-test.tsx#L32.But there are no props to
next-mdx-remote
: https://github.com/marissync/mdx-poc/blob/9aeeb3aab40234cbd5d063e96e344f0439ac96bf/pages/mdx-remote-test.tsx.So I thi…