-
Notifications
You must be signed in to change notification settings - Fork 141
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
Getting TS error Transformer<Root, Root>' is not assignable to type 'Plugin<any[], any, any>'. #423
Comments
Just playing around with this a bit with 0 exp but I suspect there may be more type issues galore than just vfile. I'm currently using pnpm which does a few nice things under the hood like using symlinks for packages. Reason I bring this up is because I get a slightly clearer error than you did:
I know exactly which versions for which packages are conflicting! Pnpm supports overrides (most package managers do, the syntax varies a tadbit but easily google-able). Anywho, I installed vfile and vfile-message directly to my project and added overrides (you may need to remove node modules and reinstall all deps as other package managers only honor overrides for first installs). And now I get the following error:
Weirdd, but looking over next-mdx-remote's dependencies and types, I suspect it's because unified might be using Hey, no more type errors! But wait, v2 -> v3 is a major upgrade and had breaking changes... read over here https://mdxjs.com/migrating/v3/ For my personal stuff, I only had to account for |
Starting to get errors on a different computer using overrides, this probably requires more thought from the maintainers... |
Just for completion of understanding the issue, it seems the ecosystem is a bit messy atm and there are a few issues surrounding. Most seem to point here unifiedjs/unified#227 |
@khinshankhan can you confirm whether this is an issue with the latest |
I don't get the type errors with |
This canary seems great, I just tested a few other plugins I was playing around with that went beyond simple type ignores eg remarkjs/remark-directive#13 and they seem to work 🎉 |
Getting similar errors using
Both 5.0.0 and canary produces this, 4.4.1 doesn't seem to trigger it |
refer to this issue: rehype-pretty/rehype-pretty-code#145
This type of 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
Seems that
next-mdx-remote
should update to the latestunified/vfile
dependencies. For now, you can ignore the type error since runtime works fine.The text was updated successfully, but these errors were encountered: