How to debug an Electron TypeScript app within Visual Studio Code

Viewed 486

I downloaded the electron-quick-start-typescript example and fail to debug it within Visual Studio Code, e.g. by setting a breakpoint. The default launch.json VS Code creates for Electron apps, doesn't work. Also the example given on their webpage doesn't work.

https://www.electronjs.org/docs/tutorial/debugging-main-process-vscode

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug Main Process",
      "type": "node",
      "request": "launch",
      "cwd": "${workspaceFolder}",
      "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
      "windows": {
        "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
      },
      "args" : ["."],
      "outputCapture": "std"
    }
  ]
}

Why does this example for instance doesn't have the --remote-debugging-port=9223 parameter? This is the given packages.json from the example.

"scripts": {
  "build": "tsc",
  "watch": "tsc -w",
  "lint": "tslint -c tslint.json -p tsconfig.json",
  "start": "npm run build && electron ./dist/main.js"
},
...

Can anyone explain me why this workflow is so broken? What am I missing here?

0 Answers
Related