Skip to content

Example VSCode Launch Script Configuration #58

Open
@arnavb

Description

@arnavb

So I wanted to see if I could get full stack debugging in VSCode working with this project and I think I've made a working launch script:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Server",
      "program": "${workspaceFolder}/server.js",
      "cwd": "${workspaceFolder}"
    },
    {
        "name": "Client",
        "type": "chrome",
        "request": "launch",
        "url": "http://localhost:3000",
        "webRoot": "${workspaceFolder}/client",
        "sourceMapPathOverrides": {
          "webpack:///src/*": "${webRoot}/src/*"
        }
      }
  ],
  "compounds": [
    {
      "name": "Server/Client",
      "configurations": ["Server", "Client"]
    }
  ]
}

Now when I run the server/client debugging combination (after running npm start in the client folder), with this config I am able to put breakpoints in client API calls and their corresponding express API routes; both of these breakpoints are successfully hit.

I was wondering if you would consider including this launch script in your project (perhaps in the README?). At least in my case, it makes the debugging experience a lot easier for VSCode, which I assume is quite commonly used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions