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

Generated ESM types have invalid export syntax #30

Open
cahilfoley opened this issue Jul 2, 2024 · 4 comments · May be fixed by #31
Open

Generated ESM types have invalid export syntax #30

cahilfoley opened this issue Jul 2, 2024 · 4 comments · May be fixed by #31

Comments

@cahilfoley
Copy link

The types published in the index.d.mts file contain an invalid export declaration for the default export which means that typescript and editors for projects using type module aren't able to reference the main function, only the signed and unsigned functions.

Here's a TS playground that shows the issue with the export statement or here's a screenshot of the editor feedback.

image

I believe the line should actually be the following instead for the .mts file

- export = crc32;
+ export default crc32;
@brianloveswords
Copy link
Owner

@cahilfoley submit a PR, bumping major version just in case this breaks something in older versions of TypeScript, and I'll accept it!

@xfournet xfournet linked a pull request Sep 16, 2024 that will close this issue
@xfournet
Copy link

Facing the same problem since the release of Typescript 5.6
@brianloveswords I have submitted the PR #31

@xfournet
Copy link

hi @brianloveswords! would be possible to merge the PR #31 and have a new release ? let me know if something is missing

@kibertoad
Copy link
Collaborator

I'll take a look later tonight!

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 a pull request may close this issue.

4 participants