Reputation: 6259
I have taken over an Electron project from another developer.
The problem I am facing is that the project does not show any errors. Even including something like throw "this is an error"
does not produce any output on the main process or render process consoles or any sort of standard error popup.
I have checked to confirm that electron-unhandled
is not in use and that nothing registers 'uncaughtException'
.
What am I missing that could cause this behavior?
Upvotes: 5
Views: 1619
Reputation: 13933
Are you facing the problem as mentioned in this official thread. You may disable the original event listeners and manage the ELECTRON_BROWSER_WINDOW_ALERT event by my event listener.
Here is the solution
ipcMain.removeAllListeners("ELECTRON_BROWSER_WINDOW_ALERT")
ipcMain.on("ELECTRON_BROWSER_WINDOW_ALERT", (event, message, title)=>{
console.warn(`[Alert] ** ${title} ** ${message}`)
event.returnValue = 0 // **IMPORTANT!**
})
Upvotes: 1
Reputation: 2847
Search for: unhandledRejection
May look something like this:
process.on('unhandledRejection', function (err) {
});
Also, make sure you include any modules in your searching for suppressors as the issue may exist somewhere in the node_modules directory and many IDE's (mine does by default) exclude that directory in indexing/searches.
Upvotes: 4
Reputation: 15797
Another possible reason could be stdout
and/or stderr
redirection, the problem is this could be achieved by several ways so it's hard to suggest you what to check...
If there is some child_process
call to launch a sub-process you could check the stdio
array used, or you can check if some low level operation is performed against file descriptors 1 and 2...
Hope this helps.
Upvotes: 3