tmijs / tmi.js

💬 Javascript library for the Twitch Messaging Interface. (Twitch.tv)
https://tmijs.com
MIT License
1.55k stars 215 forks source link

[Solved] warning: possible EventEmitter memory leak detected #359

Closed T1MOXA closed 4 years ago

T1MOXA commented 4 years ago

I getting a warning in my bot when it's starts

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.

From here https://github.com/tmijs/tmi.js/blob/master/lib/events.js#L143 i think But I don't know how I can increase the limit.

AlcaDesign commented 4 years ago

Have you tried the suggestion in the error message?

T1MOXA commented 4 years ago

I did not understand where to get emitter object

T1MOXA commented 4 years ago

At the moment I have not come up with anything better than editing the file lib/events.js

AlcaDesign commented 4 years ago

The client is the emitter.

T1MOXA commented 4 years ago

Thank you very much, now my problem is solved.