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
It used to be trivial to resize a view bound to a window via the deprecated setAutoResize. The new API that replaces BrowserView, WebContentsView, doesn't implement it.
It can be done via listeners but the current naive implementation (see add-bounded-view) doesn't sanitize those when the view is removed. Anyway, it isn't hard to imagine a situation where a window holds 10 views (tabs).
(node:151252) MaxListenersExceededWarning: Possible EventEmitter memory leak detected.
11 resize listeners added to [BrowserWindow].
MaxListeners is 10.
Use emitter.setMaxListeners() to increase limit
While it is trivial to silence these warning (as per below), let's keep it as a remainder.
modified source/server.js
@@ -13,11 +13,15 @@ if (process.argv.length != 3) {
const path = require('node:path')
const nodejs_net = require('node:net');
const fs = require('node:fs');
+const emitter = require('node:events');
// The architecture of protocol handling resorts to a tmp file, meaning that the
// main JS location may differ from the location of the current file.
const SynchronousSocket = require(path.resolve('node_modules/synchronous-socket'));
const { app, ipcMain, BrowserWindow, WebContentsView, webContents, protocol, net } = require('electron')
+emitter.setMaxListeners(0)+
app.on('ready', () => {
const server = nodejs_net.createServer((socket) => {
socket.on('data', (data) => {
It used to be trivial to resize a view bound to a window via the deprecated
setAutoResize
. The new API that replaces BrowserView, WebContentsView, doesn't implement it.It can be done via listeners but the current naive implementation (see
add-bounded-view
) doesn't sanitize those when the view is removed. Anyway, it isn't hard to imagine a situation where a window holds 10 views (tabs).While it is trivial to silence these warning (as per below), let's keep it as a remainder.
Hopefully, Electron will fix the issue, see electron/electron#43802.
The text was updated successfully, but these errors were encountered: