Hi, I saw the following error message while using vite to build a React app that imports the mdx-mermaid@2.0.0 package:
$ npm run build
> myapp@0.0.0 build
> tsc && vite build
src/components/Diagram.tsx:3:25 - error TS7016: Could not find a declaration file for module 'mdx-mermaid/lib/Mermaid'. '/Users/me/myapp/node_modules/mdx-mermaid/lib/Mermaid.mjs' implicitly has an 'any' type.
There are types at '/Users/me/myapp/node_modules/mdx-mermaid/lib/Mermaid.d.ts', but this result could not be resolved when respecting package.json "exports". The 'mdx-mermaid' library may need to update its package.json or typings.
3 import { Mermaid } from "mdx-mermaid/lib/Mermaid";
~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error in src/components/Diagram.tsx:3
Other information about my environment:
$ vite --version
vite/4.5.0 darwin-arm64 node-v20.8.1
$ node --version
v20.8.1
$ npm --version
10.1.0
$ tsc --version
Version 5.2.2
As a workaround, I used patch-package to patch the package locally.
I don't have any experience creating TypeScript or JavaScript packages. I wanted to pass along this information in case the maintainers and other people found it useful.
Hi, I saw the following error message while using
vite
to build a React app that imports themdx-mermaid@2.0.0
package:Other information about my environment:
As a workaround, I used patch-package to patch the package locally.
Here's a diff showing the patch:
I don't have any experience creating TypeScript or JavaScript packages. I wanted to pass along this information in case the maintainers and other people found it useful.
Here's a link to the GitHub Issue that led me to this workaround: https://github.com/microsoft/TypeScript/issues/52363
This issue body was partially generated by patch-package.