electron: mainWindow.webContents.openDevTools() throws error when loading new page
I am writing a simple Electron app.
I am developing on Windows 10 with the Atom Editor.
All my packages are up to date as this everything has been downloaded and installed in the past 2 weeks.
I have mainWindow.webContents.openDevTools() enabled in my app.js file.
Once the main window loads…
I have a menu item that I click which loads a new html page in the main browser window and in my command prompt window (not the browser console) I get the following error :
[4104:0310/122311.704:ERROR:CONSOLE(6639)] "Uncaught (in promise) TypeError: Cannot read property 'scriptId' of null", source: chrome-devtools://devtools/bundled/inspector.js (6639) [4104:0310/122311.704:ERROR:CONSOLE(6639)] "Uncaught (in promise) TypeError: Cannot read property 'scriptId' of null", source: chrome-devtools://devtools/bundled/inspector.js (6639)
My command prompt window is not running in legacy mode
It should be noted that no other javascript is loaded or runs when the html page loads.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 9
- Comments: 29 (3 by maintainers)
+1, happens after every reload but only if devtools is open. I don’t specify to open devtools from the main.js file.
MacOS High sierra (10.13.3) Electron: 1.8.3 Node: 8.2.1 Chrome: 59.0.3071.115
Only when devtools is open
Ubuntu 16.04.4 LTSelectron 1.8.6node v10.0.0chrome 66.0.3359.139 (Official Build) (64-bit)Using electron-react-boilerplate in case it matters.for me the error is printed out MANY times (see below).
I got the same error message as @biomade on windows 7, in Git bash, by checking Preserve log in devtools console tab. Unchecked Preserve log before reloading the view causes no error messages.
package.json
main.js
index.html
Couldn’t be reproduced on debian-linux.
I get this when my app starts. Any ideas?
[33657:1127/210324.107937:ERROR:CONSOLE(63)] "console.assert", source: devtools://devtools/bundled/sdk/CSSModel.js (63) [33657:1127/210324.107989:ERROR:CONSOLE(63)] "console.assert", source: devtools://devtools/bundled/sdk/CSSModel.js (63) [33657:1127/210324.108040:ERROR:CONSOLE(63)] "console.assert", source: devtools://devtools/bundled/sdk/CSSModel.js (63) [33657:1127/210324.108092:ERROR:CONSOLE(63)] "console.assert", source: devtools://devtools/bundled/sdk/CSSModel.js (63) [33657:1127/210324.111692:ERROR:CONSOLE(63)] "console.assert", source: devtools://devtools/bundled/sdk/CSSModel.js (63) [33657:1127/210324.111780:ERROR:CONSOLE(63)] "console.assert", source: devtools://devtools/bundled/sdk/CSSModel.js (63) [33657:1127/210324.111837:ERROR:CONSOLE(63)] "console.assert", source: devtools://devtools/bundled/sdk/CSSModel.js (63)electron v8.2.0 node v14.4.0
Edit: created a new issue for this. See: https://github.com/electron/electron/issues/27005
This is fixed in all currently supported versions of Electron.
Try replacing all the links in your application with the Link component from the ‘react-router-dom’ lib.
I was getting the same errors above until I replaced all the links with the Link component. I think it the error ‘TypeError: Cannot read property ‘_rawLocationToUILocation’ of null’ has something to do with the generated html.
I will look at it tomorrow.
sent from Agnes the android phone
On Jun 3, 2017 5:36 PM, “jellevdp” notifications@github.com wrote: