Closed khanakia closed 8 months ago
This type error is because next-mdx-remote
uses an old version of vfile
.
The main issue in your example is:
Type 'VFileMessage' is missing the following properties from type 'VFileMessage': ancestors
vfile
v6 has those properties whereas v5.3 which next-mdx-remote
uses doesn't. So the issue is next-mdx-remote
is using an older version of vfile
dependency:
https://github.com/hashicorp/next-mdx-remote/blob/main/package.json#L17
rehype-pretty-code
uses the latest version of unified
which has vfile
^6 as a dependency:
https://github.com/unifiedjs/unified/blob/b69689bba52a918d87aa62f295ccffa8d9aa8ef8/package.json#L54
cc @atomiks
Seems that next-mdx-remote
should update to latest unified
/vfile
dependencies. For now, you can ignore the type error since runtime works fine.
I am getting the below error however the code works fine when I compile