-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Must use import to load ES Module #36
Comments
just found this article https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c but I have no idea how this |
Then I would recommend importing this package using |
@sindresorhus even with dynamic imports it produces an const { default: pThrottle } = await import('p-throttle'); Any tip? |
Seems to be working here in Node 18.18.0 with something like this; const setupThrottling = async ({ limit, interval }) => {
const { default: pThrottle } = await import('p-throttle');
const throttle = pThrottle({
limit,
interval,
});
const throttled = throttle(async (callback) => callback());
return throttled;
}; const useThrottling = await setupThrottling({ limit: 1, interval: 2000 });
useThrottling(() => somethingThrottled()); |
Having a similar issue here despite using all the recommended changes. |
I'm using the sample code and got this error:
Found similar issues here
standard-things/esm#868
knex/knex#3571
The text was updated successfully, but these errors were encountered: