You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1 - Create a new react project (NextJS project in my case).
npx create-next-app@latest
2 - Install React markdown
npm install react-markdown
3- Install rehype-raw
npm install rehype-raw
Now if you try to use rehype raw with react markdown, you should get the following error:
Text version:
Type '(options?: Options | null | undefined) => (tree: Root, file: VFile) => Root' is not assignable to type 'Pluggable<any[]>'.
Type '(options?: Options | null | undefined) => (tree: Root, file: VFile) => Root' is not assignable to type 'Plugin<any[], any, any>'.
Type '(tree: Root, file: VFile) => Root' is not assignable to type 'void | Transformer<any, any>'.
Type '(tree: Root, file: VFile) => Root' is not assignable to type 'Transformer<any, any>'.
Types of parameters 'file' and 'file' are incompatible.
Type 'import("/private/tmp/my-app/node_modules/vfile/lib/index").VFile' is not assignable to type 'import("/private/tmp/my-app/node_modules/hast-util-raw/node_modules/vfile/lib/index").VFile'.
Types of property 'messages' are incompatible.
Type 'import("/private/tmp/my-app/node_modules/vfile-message/lib/index").VFileMessage[]' is not assignable to type 'import("/private/tmp/my-app/node_modules/hast-util-raw/node_modules/vfile-message/lib/index").VFileMessage[]'.
Type 'VFileMessage' is missing the following properties from type 'VFileMessage': ancestors, placets(2322)
Expected behavior
After updating rehype-raw from 6.1.1 to 7, the plugin should work seamlessly with react-markdown and not generate any TypeScript errors. It should be fully compatible right out of the box.
Actual behavior
I'm getting a typescript error after updating rehype-raw from 6.1.1 to 7
Runtime
Node v16
Package manager
npm 8
OS
macOS
Build and bundle tools
Next.js
The text was updated successfully, but these errors were encountered:
Because we treat issues as our backlog, we close duplicates to focus our work and not have to touch the same chunk of code for the same reason multiple times. This is also why we may mark something as duplicate that isn’t an exact duplicate but is closely related.
Initial checklist
Affected packages and versions
"react-markdown": "^8.0.7", "rehype-raw": "^7.0.0"
Link to runnable example
No response
Steps to reproduce
1 - Create a new react project (NextJS project in my case).
2 - Install React markdown
3- Install rehype-raw
Now if you try to use rehype raw with react markdown, you should get the following error:
Text version:
Expected behavior
After updating rehype-raw from 6.1.1 to 7, the plugin should work seamlessly with react-markdown and not generate any TypeScript errors. It should be fully compatible right out of the box.
Actual behavior
I'm getting a typescript error after updating rehype-raw from 6.1.1 to 7
Runtime
Node v16
Package manager
npm 8
OS
macOS
Build and bundle tools
Next.js
The text was updated successfully, but these errors were encountered: