'Electron - Breakpoints only work in main.js, but not in index.js
since half an hour I work on the electron-Quick-Start-Tutorial. Like the docs told me, I created the filestructure like this:
- package.json
- main.js
- index.html
Departing from the docs I did changes on the launch.json to make my project start on F5 in Visual Studio Code:
"type": "node",
"request": "launch",
"name": "Programm starten",
"program": "${workspaceRoot}/main.js",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"runtimeArgs": [
"--enable-logging"
]
My oncklick()-functions reside in index.js, that is referenced in index.html:
<script src="index.js"></script>
It's all fine, but how can I make my index.js-breakpoints work within VSC? Main.js-breakpoints stop as they should.
Thx piccus
Solution 1:[1]
can you change your launch.json like this and check this document http://electron.rocks/debugging-electron-in-vs-code-revised/
{
"name": "Debug",
"type": "chrome",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"runtimeArgs": [
"${workspaceRoot}",
"--enable-logging",
"--remote-debugging-port=9222"
],
"sourceMaps": false
}
btw if its not a typo can you change your oncKlick function to onclick()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Levent Saatci |
