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

fix(types): use type export matching module.exports #173

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ZwaarContrast
Copy link

The type in lib.d.ts uses export default where the lib.js file uses module.exports =. This will cause TypeScript under the node16 and nodenext module resolution mode to think an extra .default property access is required, but that will fail at runtime. This type should use export = instead of export default.

Further reading about the specifics of the issue can be found here: https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseExportDefault.md

This pull request aims to fix import issues for Typescript projects using --moduleResolution node16 or nodenext

@ZwaarContrast
Copy link
Author

Ah I see there is an issue with my solution. Will revisit the pull request at a later time!

@ZwaarContrast ZwaarContrast marked this pull request as draft September 18, 2023 10:05
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

Successfully merging this pull request may close these issues.

1 participant