mottox2 / remark-code-titles

16 stars 2 forks source link

Error: Cannot handle unknown node `raw` #6

Open talatkuyuk opened 2 years ago

talatkuyuk commented 2 years ago

I am working with next-mdx-remote. When I use your plugin, my nextjs app throws an error:

More information: https://mdxjs.com/docs/troubleshooting-mdx error - Error: [next-mdx-remote] error compiling MDX: Cannot handle unknown node raw

I have found another implementation here by @timlrx about code titles which works perfectly.

I don't know why the problem occurs, could be mdxjs ver 1.0 or 2.0. Maybe you consider the code which I've provided at above link.

Thanks.

thinceller commented 2 years ago

The same error happens to me. I use this plugin with next-mdx-remote and @mdx-js/react.

This occurred during the upgrade process of next-mdx-remote from v3 to v4 (including from MDX v1 to v2).

thinceller commented 2 years ago

In my case, using rehype-code-titles instead as a workaround solved the problem. In that case, note that rehype-code-titles should be read in before rehype-prism or similar.

talatkuyuk commented 1 year ago

After waiting 8-9 months for the issue, supposing will not be maintained...

I created a new npm package remark-flexible-code-titles to add title element or container element or both for the code nodes in markdown.

You can customize the tag name and classnames as well.

It also supports mdx2. It is tested with next-mdx-remote, it works.