You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If remote is in use in the renderer and the page is reloaded >10 times (via location.reload() or webContents.reload()), the following scary sounding warning appears in the Node console:
MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 render-view-deleted listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
Took me a while to trace it to this package but I was able to isolate and confirm. Happens since at least Electron 15 all the way through latest v21, on Win and Mac. Basically if you run this code in a renderer 10 times:
the warning is thrown. Looks like merely doing require('@electron/remote') alone won't trigger the warning but actually accessing any object through remote will. I wonder if there is some cleanup that's not being done on page reloads? I know the docs say to make sure to clean up interprocess references when using remote, but something as simple as require('@electron/remote').app.getPath('exe') isn't even creating a persistent reference so I'm not sure what I could be doing wrong.
The text was updated successfully, but these errors were encountered:
If remote is in use in the renderer and the page is reloaded >10 times (via
location.reload()
orwebContents.reload()
), the following scary sounding warning appears in the Node console:Took me a while to trace it to this package but I was able to isolate and confirm. Happens since at least Electron 15 all the way through latest v21, on Win and Mac. Basically if you run this code in a renderer 10 times:
the warning is thrown. Looks like merely doing
require('@electron/remote')
alone won't trigger the warning but actually accessing any object through remote will. I wonder if there is some cleanup that's not being done on page reloads? I know the docs say to make sure to clean up interprocess references when using remote, but something as simple asrequire('@electron/remote').app.getPath('exe')
isn't even creating a persistent reference so I'm not sure what I could be doing wrong.The text was updated successfully, but these errors were encountered: