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

Incorrect default export in types #228

Open
sidharthv96 opened this issue Oct 2, 2024 · 0 comments
Open

Incorrect default export in types #228

sidharthv96 opened this issue Oct 2, 2024 · 0 comments

Comments

@sidharthv96
Copy link

sidharthv96 commented Oct 2, 2024

https://arethetypeswrong.github.io/[email protected]

Incorrect default export

The resolved types use export default where the JavaScript file appears to use module.exports =. This will cause TypeScript under the node16 module mode to think an extra .default property access is required, but that will likely fail at runtime. These types should use export = instead of export default.

This was a problem in mermaid-js/mermaid#5825, as we had to @ts-ignore all the places where rough was used.

Adding a .default does show the types.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@sidharthv96 and others