Skip to content

Debugging translationCore with VisualStudio Code

Joel edited this page Dec 13, 2018 · 2 revisions

The main process

To set up debugging for the main process check out this article https://electron.rocks/debugging-electron-in-vs-code/

The render process

  1. Install the "Debugger for Chrome" plugin.
  2. Add this argument at the end of the run command in package.json -remote-debugging-port=9222
  3. Add the following debug configuration to VSC:
 {
    "version": "0.2.0",
        
    "configurations": [
        {
            "type": "chrome",
            "request": "attach",
            "name": "Attach to Chrome",
            "port": 9222,
            "webRoot": "${workspaceFolder}"
        }
    ]
}
  1. add a breakpoint to your code
  2. start the app with npm start
  3. attach the debugger from within VSC.

below is a demonstration:

demo