-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems parsing frontmatter #15
Comments
Had the same issue. The problem is apparent remark-gfm v3. By upgrading to v4 it solved the problem. (also make sure to remove contentlayer from node-modules and update imports to contentlayer2 since the first time I did this It was still using the first package 🤦 ) |
|
@timlrx thanks for the quick reply. I just checked again and at least I hope i updated all the plugins (luckily typescript also warns if you forget!). This is the repo/branch I am trying to update: https://github.com/marigold-ui/marigold/tree/contentlayer2 You find the next app under
|
If I can help investigate, let me know! |
I investigated a bit more, it seems like our Specifically this code: The |
Since this is not an issue with |
It seems that the order matters. This works: rehypePlugins: [
[
rehypePrettyCode,
{
...DEFAULT_REHYPE_PRETTY_CODE_OPTIONS,
theme: {
dark: "github-dark",
light: "github-light"
},
transformers: [
// FIXME: Make it actually work. Currently it doesn't transform the code blocks.
transformerTwoslash({
explicitTrigger: true,
renderer: rendererClassic()
})
]
} satisfies RehypePrettyCodeOptions
],
[rehypeRaw, { passThrough: nodeTypes }],
rehypeMdxCodeProps,
rehypeSlug
] This works, but incorrectly: rehypePlugins: [
[rehypeRaw, { passThrough: nodeTypes }],
[
rehypePrettyCode,
{
...DEFAULT_REHYPE_PRETTY_CODE_OPTIONS,
theme: {
dark: "github-dark",
light: "github-light"
},
transformers: [
// FIXME: Make it actually work. Currently it doesn't transform the code blocks.
transformerTwoslash({
explicitTrigger: true,
renderer: rendererClassic()
})
]
} satisfies RehypePrettyCodeOptions
],
rehypeSlug,
rehypeMdxCodeProps
] Any other config (haven't tried them all, but most of them) lead to the frontmatter error. |
I have the same problem. Does anybody know what to order how? Putting Update: |
Hey! First of all thanks for continuing with this lib! 🥳
I tried to upgrade our project but ran into an issue. It seems like
contentlayer2
has an issue with parsing frontmatter in.mdx
files:I tried to add the remark plugin like described here. But it seems like the issue is
contentlayer
internal. Looking at the code,contentlayer
should be able to parse frontmatter already.Is this a known issue or is it something on our side?
The text was updated successfully, but these errors were encountered: