Skip to content

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