Closed pegatron closed 5 years ago
After spending some hours, I've perhaps found the root cause. I would like to create a PR for adding direct support in electron-forge environment. Since I'm until now not experienced in JavaScript/TypeScript/NodeJS/Electron/VSCode world, perhaps somebody has an advise where to start and what projects would be involved.
VSCode debugging using the "legacy" V8 debug protocol cannot resolve TS files that have no corresponding JS file. Using the V8 inspector protocol, it should work. I came up to this because debugging ts-node projects or mocha projects that use ts-node can only be debugged with the "inspector" debug protocol, see
Electron on the other hand isn't supporting it at the moment in the releases, but there is the electron/electron pull request #9473 which is already merged in master that enables that and will be available with electron v1.7.2.
So, here my question: can somebody give me some rough hints
Many thanks in advance
what is to do to update electron-forge and friends to Electron v1.7.2 when it's released?
You simply have to update the version of electron-prebuilt-compile
in your package.json
what is to do that the --inspect=
switch can be given over the chain from electron-forge to reach Electron?
It would require modifications /additions to our existing vscode debug logic, see the debug launcher files
https://github.com/electron-userland/electron-forge/blob/master/script/vscode.cmd
https://github.com/electron-userland/electron-forge/blob/master/script/vscode.sh
Actually, it probably won't require any modifications to our existing vscode launchers, will see when 1.7.2 is out 👍
Please describe your issue:
I have initialized a new electron-forge project with the angular2 template and wanted to have debugging support from Visual Studio Code. Following the documentation works for the default template, but not for the angular2 template.
After starting the debugging session, the red marked break points are getting grey, what means, that VSCode cannot debug them. I set them in (unmodified)
src/index.ts
from the template.It would be great if the VSCode integration would work also for the angular2 template.
*Console output when you run
electron-forge init
with the environment variable `DEBUG=electron-forge:`. (Instructions on how to do so here). Please include the stack trace if one exists.**What command line arguments are you passing?
Please see above answer
What does your
config.forge
data inpackage.json
look like?Didn't changed from template
Please provide either a failing minimal testcase (with a link to the code) or detailed steps to reproduce your problem.
Copy launch.json configuration from documentation. Comment the array
runtimeArgs
.Hit F5 after setting some break points in
src/index.ts
.As soon as the app is started, the break points turn grey. Break points don't work in
src/index.ts
.With the default template, the break points work without issue.