MaxListenersExceededWarning for rtc.audio_output_device_changed

Good day,

I developed an application with the help of lib-jitsi-meet that allows users to dynamically join a new conference on a web application, so without reloading the page.

I achieved this by calling the disconnect function of the JitsiConnection and creating a new JitsiConnection with the new Jitsi serviceUrl.

However, after moving rooms a few times, I get the following warning:

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 rtc.audio_output_device_changed listeners added. Use emitter.setMaxListeners() to increase limit
    at d (https://meet.jit.si/libs/lib-jitsi-meet.min.js:2:70981)
    at r.addListener (https://meet.jit.si/libs/lib-jitsi-meet.min.js:2:73565)
    at Si.addListener (https://meet.jit.si/libs/lib-jitsi-meet.min.js:2:340176)
    at new Ao (https://meet.jit.si/libs/lib-jitsi-meet.min.js:2:508323)
    at https://meet.jit.si/libs/lib-jitsi-meet.min.js:2:575794
    at Array.map (<anonymous>)
    at va (https://meet.jit.si/libs/lib-jitsi-meet.min.js:2:575654)
    at https://meet.jit.si/libs/lib-jitsi-meet.min.js:2:577066

We add some custom event & command listeners to the JitsiConnection and JitsiConference but even removing them during the disconnect event does not seem to resolve this error.

I would love if someone has an idea on how we can avoid this warning.

1 Like

I have the same warning on my browser, have a self hosted instance serving it via https://meet.jit.si/external_api.js script.

Hi @ckeiner, can you please update us if you’ve found a solution for this issue?

Hi, sorry for my late response.

I have not checked yet, but after I followed Track Added and Directly Removed - #6 by saghul it seems to have vanished. So you may want to check if you are properly entering and leaving conferences.