I want to see the errors on the client side but if i create an error in the renderer then it always says that the error happend in preload.js with no indication of where it really happened (in renderer).
I am not going to change these:
contextIsolation: true,
nodeIntegration: true,
nodeIntegrationInSubFrames: true,
enableRemoteModule: false,
sandbox: false,
I cant import or require in renderer.js so this is not able to work:
// main.js:
const ipc = require('electron').ipcMain;
ipc.on('errorInWindow', function(event, data) {
console.log(data)
});
// renderer.js
import { ipcRenderer } from 'electron';
window.onerror = function(error, url, line) {
ipcRenderer.send('errorInWindow', error);
};
Am I suppose to bundle this?! seams overkill!
<body>
<script src="path/to/electron.js"></script>
<script src="renderer.js"></script>
</body>
I don’t want the errors even going to preload.js! I don’t want to send them from preload to main ether, really I just want a renderer error to go straight to the client side console!!
Please