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 incorrect default export in TS declaration file #731

Closed
wants to merge 1 commit into from

Conversation

andrewbranch
Copy link

The TS declaration file is loaded by TypeScript in the "typings" field of package.json. This field corresponds to the "main" field, which is set to ./dist/fuse.common.js, which does

module.exports = Fuse;

The correct TS representation of module.exports = Fuse is export = Fuse, not export default Fuse.

This is the root cause of many previous reports:

and was brought to my attention at microsoft/TypeScript#50058 (comment).

You can see the bug is also detected at https://arethetypeswrong.github.io/?p=fuse.js%406.6.2. Explainer: https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseExportDefault.md.

Note also:

I’ve thrown a lot of information at you, but I’m happy to answer any questions or concerns you may have!

@jstasiak
Copy link

I just tried this patch locally and it worked.

@andrewbranch
Copy link
Author

This may be superseded by #727

@favna
Copy link
Contributor

favna commented Aug 7, 2023

I have processed your review comment on #727 so I think you can close this one @andrewbranch

@andrewbranch
Copy link
Author

Awesome!

@andrewbranch andrewbranch deleted the patch-1 branch August 7, 2023 15:27
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.

3 participants