Skip to content

Debugging support with VS Code #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
crazyRaisy opened this issue Feb 6, 2018 · 1 comment
Open

Debugging support with VS Code #75

crazyRaisy opened this issue Feb 6, 2018 · 1 comment

Comments

@crazyRaisy
Copy link

Hi,

thx for doing this great boilerplate project. It help´s a lot when starting development with react and electron! Great!
The only thing I am missing is a good debugging support out of my IDE. Is it possible to debug the main/render thread with VS-Code even when using the devserver (npm run dev)? What I have to do to configure the debugger properly?

@EbenZhang
Copy link

EbenZhang commented Nov 29, 2018

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [  
        {
            "type": "node",
            "request": "launch",
            "name": "Electron: Main",
            "protocol": "inspector",
            "sourceMaps": true,
            "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
            "program": "${workspaceFolder}/server.js",
            "cwd": "${workspaceRoot}/app",            
            "runtimeArgs": [
                ".",
                "--enable-logging",
                "--remote-debugging-port=9223",
            ]
        },
          {
              "name": "Electron: Renderer",
              "type": "chrome",
              "request": "attach",
              "port": 9223,
              "webRoot": "${workspaceFolder}",
              "timeout": 30000,
              "sourceMaps": true,
          }
    ],
    "compounds": [
          {
              "name": "Electron: All",
              "configurations": [
                  "Electron: Main",
                  "Electron: Renderer"
              ]
          }
      ]
    }

Above is my vscode launch.json. But I have to launch the Main first and then the Renderer, sometimes launch All works too but sometimes not, seems a race conditions issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants