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

MaxListenersExceededWarning #40

Closed
SeverinAlexB opened this issue Feb 15, 2023 · 4 comments · Fixed by #48
Closed

MaxListenersExceededWarning #40

SeverinAlexB opened this issue Feb 15, 2023 · 4 comments · Fixed by #48
Labels
bug Something isn't working

Comments

@SeverinAlexB
Copy link

Environment

  • OS: macOS
  • Node Version: v18.12.1
  • Package: @clack/prompts
  • Package Version: v0.2.2

Describe the bug

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 end listeners added to [ReadStream]. Use emitter.setMaxListeners() to increase limit

To Reproduce
After using the await select a lot, the warning message above shows up.

Expected behavior
Should not show up.

Additional Information
CleanShot 2023-02-15 at 10 12 03@2x

Let me know if you got questions. It's probably just even emitter listener cleanup.

@SeverinAlexB SeverinAlexB added the bug Something isn't working label Feb 15, 2023
@SeverinAlexB SeverinAlexB changed the title [Bug] MaxListenersExceededWarning Feb 15, 2023
@wrodriguez83
Copy link

It happens to me too, but after 10 differents prompts (confirms, select, inputs, etc)

@wrodriguez83
Copy link

I found a temporal solution, I added this code in my index.ts:

import { EventEmitter } from "node:stream"; EventEmitter.setMaxListeners(0);

I hope that it helps you, while the bug is fixed

ulken added a commit to ulken/clack that referenced this issue Feb 16, 2023
@ulken
Copy link
Collaborator

ulken commented Feb 16, 2023

I looked into this and think I found the culprit (at least the warning no longer shows up after generating 10+ prompts).

@kyllan16693
Copy link

I still have this issue. Is the best work around setting max emitters to 0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants