Skip to content
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

Typescript compatibility with rehype-raw v7 #763

Closed
4 tasks done
Slessi opened this issue Aug 26, 2023 · 4 comments
Closed
4 tasks done

Typescript compatibility with rehype-raw v7 #763

Slessi opened this issue Aug 26, 2023 · 4 comments
Labels
👯 no/duplicate Déjà vu 👎 phase/no Post cannot or will not be acted on

Comments

@Slessi
Copy link

Slessi commented Aug 26, 2023

Initial checklist

Affected packages and versions

react-markdown 8.0.7 + rehype-raw 7.0.0

Link to runnable example

https://codesandbox.io/s/beautiful-sound-vthj8w?file=/src/App.tsx

Steps to reproduce

Just try to use rehype-raw v7 with react-markdown v8.0.7. I don't know why but the codesandbox version does not reproduce the issue 🙄 but with the same environment locally as in the sandbox, I get it.

Issue seems to be (as far as I can tell) because rehype-raw v7 uses vfile v6 and/or unified v11.

image

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("/Users/edward/Projects/tmp/node_modules/vfile/lib/index").VFile' is not assignable to type 'import("/Users/edward/Projects/tmp/node_modules/hast-util-raw/node_modules/vfile/lib/index").VFile'.
            Types of property 'messages' are incompatible.
              Type 'import("/Users/edward/Projects/tmp/node_modules/vfile-message/lib/index").VFileMessage[]' is not assignable to type 'import("/Users/edward/Projects/tmp/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

TS compiles

Actual behavior

TS errors

Runtime

Node v17

Package manager

npm 8

OS

macOS

Build and bundle tools

Vite

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Aug 26, 2023
@ChristianMurphy
Copy link
Member

Duplicate of unifiedjs/unified#228

@ChristianMurphy ChristianMurphy marked this as a duplicate of unifiedjs/unified#228 Aug 26, 2023
@ChristianMurphy ChristianMurphy closed this as not planned Won't fix, can't repro, duplicate, stale Aug 26, 2023
@github-actions

This comment has been minimized.

@ChristianMurphy
Copy link
Member

The updates are making their way through several hundred packages, for now pin the previous major until the new react-markdown major is released

@github-actions
Copy link

Hi! Thanks for taking the time to contribute!

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.

Thanks,
— bb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👯 no/duplicate Déjà vu 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

2 participants