-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
Usage with ESM in NodeJS is unintuitive #127
Comments
Oh, after further investigation I think it's a tsc/NodeJS issue |
What does your tsconfig look like? |
@f1yn I'm testing it without typescript, using ESM in NodeJS: // package.json
{
"type": "module",
"dependencies": {
"p-queue": "^6.6.2"
}
} // index.js
import { default as PQueue } from 'p-queue'
const queue = new PQueue.default() // Works But I think this behavior is expected when using NodeJS. Maybe consider publishing ESM and CJS versions? |
@f1yn I am running into the same problem. My tsconfig looks like:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this awesome library! From April 2021 all stable Node.js versions support ESM. So I've added
"type": "module"
to package.json and tried to create a queue:Is this expected? It looks very unintuitive and also doesn't work with Typescript (
Property 'default' does not exist on type 'typeof PQueue'.ts(2339)
)The text was updated successfully, but these errors were encountered: