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

Types don't match code when this library is used in ESM #38

Open
kaiyoma opened this issue May 25, 2023 · 1 comment
Open

Types don't match code when this library is used in ESM #38

kaiyoma opened this issue May 25, 2023 · 1 comment

Comments

@kaiyoma
Copy link

kaiyoma commented May 25, 2023

This library is CJS, so when used from an ESM module, you have to do this:

import millify from 'millify';

millify.default(...)

However, this doesn't match up with the published types, which expect the default export to be used directly.

@kaiyoma
Copy link
Author

kaiyoma commented May 25, 2023

Hmm, I'm having trouble getting this library to work in all scenarios when using ESM. Sometimes it needs .default and sometimes it doesn't. Publishing an ESM version of this library would probably fix this, or maybe switch the API so the default export is a namespace rather than a function?

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

1 participant