Open codedusting opened 2 months ago
You receive the error because you have not provided the scope
in the options.
The mdx source you fetched consists an expression {entry.fields.previewSlug}
, and you should provide that information inside the scope.
<MDXRemote
source={readme}
options={{
scope: {
entry: { fields: { previewSlug: "any value here"}}
}
}}
/>
Describe the bug
I have a readme file at my github repository which I am fetching in the RSC component and then trying to utilise the MDXRemote component to render the content. But it's giving the error
⨯ Internal error: ReferenceError: entry is not defined
.Code:
Reproduction
Internal error: ReferenceError: entry is not defined is what we will get on running the above code in any RSC Page
next-mdx-remote version
^5.0.0