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

Missing typings and typescript files from @mdx-js/mdx #1552

Closed
floroz opened this issue May 12, 2021 · 4 comments
Closed

Missing typings and typescript files from @mdx-js/mdx #1552

floroz opened this issue May 12, 2021 · 4 comments
Labels
🙋 no/question This does not need any changes

Comments

@floroz
Copy link

floroz commented May 12, 2021

Subject of the issue

Missing typescript files and typings from @mdx-js/mdx.

I have installed version "@mdx-js/mdx": "^1.6.22", but I cannot see any typings.

If I look into my node_modules folder, this is the output:

Screenshot 2021-05-12 at 15 32 22

There is no TypeScript nor .d.ts files.

Steps to reproduce

  1. I create an empty folder
  2. I run yarn init -y
  3. I do a yarn add -D @mdx-js/mdx
  4. I try import a default export or a named export
  5. TSC compiler throws an error: Could not find declaration files for @mdx-js/mdx, etc...

Screenshot 2021-05-12 at 15 41 50

@floroz floroz added 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels May 12, 2021
@floroz
Copy link
Author

floroz commented May 12, 2021

I can see the Typings being referenced both in the documentation: https://mdxjs.com/advanced/typescript#typings-for-mdx-imports and in the source code: https://github.com/mdx-js/mdx/tree/main/packages/mdx/types

@ChristianMurphy
Copy link
Member

The documentation you are looking at is for version 2.
Either run version 2 (see #1041 for more info)
Or follow the guide for version 1 https://github.com/mdx-js/mdx/blob/master/docs/advanced/typescript.mdx

@ChristianMurphy ChristianMurphy added 🙋 no/question This does not need any changes and removed 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels May 12, 2021
@floroz
Copy link
Author

floroz commented May 13, 2021

Thank you @ChristianMurphy

@lostfictions
Copy link

hey there, just ran into this as well -- maybe the website should note somewhere that the documentation is for a pre-release version and won't work as described?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 no/question This does not need any changes
Development

No branches or pull requests

3 participants