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

Import footgun: Default export versus named export (No output when used via API) #399

Closed
rezonant opened this issue Dec 31, 2022 · 2 comments · Fixed by #456
Closed

Import footgun: Default export versus named export (No output when used via API) #399

rezonant opened this issue Dec 31, 2022 · 2 comments · Fixed by #456
Milestone

Comments

@rezonant
Copy link

I got bit by accidentally importing as import { concurrently } from 'concurrently'; instead of import concurrently from 'concurrently';. The default export applies all the default controllers and logger, whereas the named export does not (the default export uses the "unconfigured" named export to do it's thing).

It might be worth adding a note to the README about this or possibly renaming the named export to make it harder to fall into this trap.

The symptoms are that no program output appears, even though it does when you use the concurrently CLI- this is of course because there is no Logger or LogOutput/LogError controllers added in the configuration.
I ended up having to dig into the source code to figure this out.

At the very least, this issue should provide some help for anyone else who hits this footgun.

@gustavohenke
Copy link
Member

You've raised an excellent point!
I suppose that renaming the unconfigured function to createConcurrently would be better, but that'd be a breaking change 😕

@paescuj paescuj added this to the v8 milestone Jan 3, 2023
@paescuj
Copy link
Collaborator

paescuj commented Jan 3, 2023

I suppose that renaming the unconfigured function to createConcurrently would be better, but that'd be a breaking change 😕

Might be something for v8 v9?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants