electron: [Bug]: Typing in Devtools causes crashes (onerror handler is hit)
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
19.0.0
What operating system are you using?
Windows
Operating System Version
Windows 10
What arch are you using?
x64
Last Known Working Electron version
18.3.0
Expected Behavior
I should be able to type in the devtools without triggering the window’s onerror
handler.
Actual Behavior
onerror
is triggered with the error: “Possible side-effect in debug-evaluate”
Testcase Gist URL
https://gist.github.com/54d5f29ef2094fe21e5ba6b2de4ca876
Additional Information
- start app
- type something in devtools
- observe the error popup
Here’s the code I’m running:
main.js:
const {app, BrowserWindow} = require('electron')
async function createWindow () {
const mainWindow = new BrowserWindow()
await mainWindow.loadFile('index.html')
mainWindow.webContents.openDevTools()
}
app.whenReady().then(() => {
createWindow()
})
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})
index.html:
<script src="./renderer.js"></script>
renderer.js:
window.onerror = (e, url, line, col, error) => {
alert(error.message);
};
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 5
- Comments: 19 (5 by maintainers)
Links to this issue
Commits related to this issue
- Add workaround for an Electron 19 crash This crash happens when attempting to write anything in the Dev Tools console. See https://github.com/electron/electron/issues/34350 — committed to desktop/desktop by sergiou87 2 years ago
- Add workaround for an Electron 19 crash This crash happens when attempting to write anything in the Dev Tools console. See https://github.com/electron/electron/issues/34350 — committed to s7ab059789/desktop by sergiou87 2 years ago
This was caused by https://chromium-review.googlesource.com/c/v8/v8/+/3557234/ and fixed in https://chromium-review.googlesource.com/c/v8/v8/+/3660253 - it’ll be resolved when we roll Chromium to contain the fix.
@codebytere Are you sure? I just tested in 19.0.8 and 20.0.0-beta.8 and it wasn’t for me (Windows).
@remss Oh, I think we’re talking about different issues. You’re saying that if you execute code in the devtools that causes an error (because
foo
isn’t defined for example), the error handler gets triggered.This issue was meant to track that typing any character into devtools (without hitting Enter) was triggering the
onerror
handler per character. That behavior was fixed in Electron 20.The same problem with 102.0.5005.63 Chrome version, should wait for the next release?