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 (
    at r.addListener (
    at Si.addListener (
    at new Ao (
    at (<anonymous>)
    at va (

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 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.