-
-
Notifications
You must be signed in to change notification settings - Fork 135
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 import from ES Module #92
base: main
Are you sure you want to change the base?
Conversation
The problem was that Node was treating files in dist/esm as CommonJS. The solution would be rename them to .mjs or add a package.json with `type: module`. This commit chooses the second option.
This does not work. I tried it and it has problems with
|
Also, I tried to import it like it says in the error here in clock.js and then it can't figure out
|
Yes, it won't work right now. A similar fix needs to be done for just-performance too. To test it locally, go to node_modules/just-performance/dist/esm and add a package.json. Similar to what this PR adds for node-rate-limiter. package.json
|
I wish I had seen your comment before now. It would have saved me some time.. I figured out the same thing you suggested and it worked. 🥲 |
The problem was that Node was treating files in
dist/esm
as CommonJS. The solution would be to rename all files indist/esm
to.mjs
or add a package.json withtype: module
. This PR chooses the second option.Fixes #80