Skip to content

Console.log bug: MaxListenersExceededWarning #1876

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

Closed
Zoddo opened this issue Apr 20, 2019 · 8 comments
Closed

Console.log bug: MaxListenersExceededWarning #1876

Zoddo opened this issue Apr 20, 2019 · 8 comments

Comments

@Zoddo
Copy link

Zoddo commented Apr 20, 2019

  • Version: v11.14.0
  • Platform: Linux zoddo 4.9.0-8-amd64 Update README for help #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux
  • Subsystem:

I got this error:

(node:7834) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:251:17)
    at WriteStream.addListener (events.js:267:10)
    at WriteStream.Readable.on (_stream_readable.js:838:35)
    at WriteStream.once (events.js:296:8)
    at Console.(anonymous function) (internal/console/constructor.js:240:12)
    at Console.log (internal/console/constructor.js:287:26)
    at Logger.log (/<snip>/src/util/Logger.js:50:13)
    at Shard.onLog (/<snip>/src/Shard.js:51:25)
    at Shard.emit (events.js:193:13)
    at Shard.EventEmitter.emit (domain.js:481:20)

I was not able to produce a simple script that reproduce this error (I don't know exactly which condition trigger this bug), but I'm able to reproduce it anytime in my code.

From what I can see on the stacktrace, the EventEmitter instance which produce this warning is internal to node. The listeners seem to be registered during a console.log() call.

@cjihrig cjihrig transferred this issue from nodejs/node Apr 20, 2019
@ollisal
Copy link

ollisal commented Apr 25, 2019

Ditto, on Node.js v12.0.0.

@Zoddo
Copy link
Author

Zoddo commented May 5, 2019

I don't know why this issue was moved there. It's a bug report, not an help request.

@gireeshpunathil
Copy link
Member

@Zoddo - can you please share your test case?

@Zoddo
Copy link
Author

Zoddo commented May 5, 2019

As said, I'm not able to produce a simple test case (this bug is probably triggered under specific conditions). But the EventEmitter generating this error is internal to node (just take a look at the stack trace).

Maybe @ollisal can have more chances than me, and provide a test case.

@zetos
Copy link

zetos commented Sep 23, 2019

Had the same issue when i was using node v12.9.0 it was solved when i upgraded to node v12.10.0.

@gianpaj
Copy link

gianpaj commented Mar 29, 2020

I'm getting this issue on OSX node v13.5.0 when running:

npx npkill
(node:11672) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 data listeners added to [Socket]. Use emitter.setMaxListeners() to increase limitess

@PoojaDurgad
Copy link

@Zoddo , is this still an issue?

@gireeshpunathil
Copy link
Member

inactive, closing

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

6 participants