Closed tracycollins closed 3 years ago
I have the same problem. The issue is that node requires all import
statements to have a .js
at the end. The way this project is transpiled doesn't work with Node ESM.
@richardsimko thanks for catching that. Let me get a fix together.
This PR fails because jest (using babel) can no longer resolve the import paths (see https://travis-ci.org/github/jhurliman/node-rate-limiter/jobs/769026954). I'm searching for a solution that will work for both Node ESM and Jest+Babel.
I added a transform step during compilation to append .js
to imports. This should be fixed now, please let me know if you run into issues. 2.0.1 has been published.
Works for me. Thanks!
Not sure if this is a case of "pilot error" but after upgrading this package and switching to 'import' from 'require' in my code, I'm getting the following error (when I try to run my tests with mocha):
I'm importing as in the README:
import { RateLimiter } from "limiter";
I've added the most recent version (limiter@2.0.0) using 'yarn add limiter'
Am I doing something wrong? Any help appreciated