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
Add a call to Sentry.init on renderer. (I'm using React, so this is called outside the App component)
Refresh the page a few times (probably 10~15 times).
Expected Result
No warning.
Actual Result
Warning:
(node:19700) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Worker]. Use emitter.setMaxListeners() to increase limit
If you add process.on('warning', e => console.warn(e.stack)) on your main process you can see the stack trace:
MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 destroyed listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
at _addListener (node:events:587:17)
at EventEmitter.addListener (node:events:605:10)
at EventEmitter.once (node:events:649:8)
at IpcMainImpl.<anonymous> (D:\repo\node_modules\@sentry\electron\src\src\main\ipc.ts:268:14)
at IpcMainImpl.emit (node:events:513:28)
at IpcMainImpl.emit (node:domain:489:12)
at EventEmitter.<anonymous> (node:electron/js2c/browser_init:2:81099)
at EventEmitter.emit (node:events:513:28)
at EventEmitter.emit (node:domain:489:12)
// In older Electron, sender can be destroyed before this callback is called
if(!sender.isDestroyed()){
// Keep track of renderers that are using IPC
KNOWN_RENDERERS=KNOWN_RENDERERS||newSet();
KNOWN_RENDERERS.add(id);
sender.once('destroyed',()=>{
KNOWN_RENDERERS?.delete(id);
});
}
});
I think it could be updated to:
if (!sender.isDestroyed()) {
// Keep track of renderers that are using IPC
KNOWN_RENDERERS = KNOWN_RENDERERS || new Set();
+ if (KNOWN_RENDERERS.has(id)) {+ return;+ }
KNOWN_RENDERERS.add(id);
sender.once('destroyed', () => {
KNOWN_RENDERERS?.delete(id);
});
}
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Electron SDK Version
4.20.0
Electron Version
22.3.27
What platform are you using?
Windows
Link to Sentry event
No response
Steps to Reproduce
Sentry.init
on renderer. (I'm using React, so this is called outside theApp
component)Expected Result
No warning.
Actual Result
Warning:
If you add
process.on('warning', e => console.warn(e.stack))
on your main process you can see the stack trace:Which points to this part of Sentry's code:
sentry-electron/src/main/ipc.ts
Lines 259 to 272 in 02322af
I think it could be updated to:
The text was updated successfully, but these errors were encountered: