Closed likhit-vivek closed 3 years ago
Hi @likhit-vivek ,
Can you share the function code that contains this code block? From an initial reading, I don't see why "trackSubscribed" is listened to 11 times.
Thanks,
Manjesh Malavalli JSDK Team
Even I couldn't understand why it was happening as I was subscribing to only the events mentioned in twilio video docs. But it always happened previously. I was able to fix it by adding this line of code inside the connect function immediately after a user/client joins the room
room.removeAllListeners(['participantConnected', 'participantDisconnected', 'dominantSpeakerChanged', 'disconnected']);
You can close this issue now.
I'm getting this same issue and removeAllListeners
isn't helping. Mine is adding 11 listeners as well, which is odd.
Any update on this issue?
This issue is happening when 3 of us joined the call. Using latest twilio JavaScript version.
This is the error:
bundle.js:11160 MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 "trackSubscribed" listeners added. Use emitter.setMaxListeners() to increase limit. _addListener @ bundle.js:11160 3bundle.js:583 Dominant speaker changed: bundle.js:11160 MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 "trackSubscribed" listeners added. Use emitter.setMaxListeners() to increase limit. _addListener @ bundle.js:11160
This is the code where I'm using
trackSubscribed
event: