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

ERR_REQUIRE_ESM Problem #85

Closed
v-menzhou opened this issue Aug 19, 2021 · 1 comment
Closed

ERR_REQUIRE_ESM Problem #85

v-menzhou opened this issue Aug 19, 2021 · 1 comment

Comments

@v-menzhou
Copy link

Saw this issue was posted before, #80. and we are encouraged to create ES module by following the link:

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

In our case, we have a utility library X that is commonjs module. Since verison 9, mem becomes ES module, therefore, we change X to ES module as well. because X is a lib used by many other commonjs projects. We now are in a difficult position to either to use mem of version 9 below, or to convert all commonjs projects to ES projects.

As for issue 80, my understanding is for those typescript projects, basically, we can not use version 9 or after?

Since mem is a popular utility, and changing it to pure ES module has a huge change impact. Wonder if we could offer distributions of both ES and commonjs module? I do not know how to make this work, the link below is encouraging:
https://github.com/jhurliman/node-rate-limiter/blob/main/package.json#L10

Thanks for your consideration!

@sindresorhus
Copy link
Owner

I don't have any plans to offer dual package as that is even worse than not: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#gistcomment-3850849

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

2 participants