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

TypeScript types are wrong when module is node16 #494

Closed
dstaley opened this issue Jul 31, 2024 · 3 comments
Closed

TypeScript types are wrong when module is node16 #494

dstaley opened this issue Jul 31, 2024 · 3 comments
Milestone

Comments

@dstaley
Copy link

dstaley commented Jul 31, 2024

When using concurrently in a project with module set to node16 (or nodeNext) in tsconfig.json, the default export of concurrently is not correct:

import concurrently from 'concurrently'
concurrently(); // This expression is not callable. Type 'typeof import("node_modules/concurrently/dist/src/index")' has no call signatures.

I believe this is due to the fact that the types field points to dist/src/index.d.ts for both the require and import fields in exports, which is not going to work since the files are two different module systems. You can see more compatibility issues here.

I'm happy to send in a PR to fix this in a few days, but I just wanted to throw the issue out there for awareness.

@gustavohenke
Copy link
Member

Hey! I believe this might've been fixed by #456, it's just that it hasn't been released yet.
It's been a while since I played with the type definitions, so at least https://arethetypeswrong.github.io gives all ✅ with the output of npm pack.

@dstaley
Copy link
Author

dstaley commented Aug 6, 2024

oh you're totally right! it looks like that PR should solve the issue. sorry for the noise!

@dstaley dstaley closed this as completed Aug 6, 2024
@gustavohenke gustavohenke added this to the v9 milestone Aug 6, 2024
@gustavohenke
Copy link
Member

Hey! This is now fixed in v9.0.0.
https://github.com/open-cli-tools/concurrently/releases/tag/v9.0.0

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