microsoft / microsoft/vscode-js-debug

Debugger tries to attach instead of launch

Open
#1,518 12 comments 0 reactions 1 assignee View on GitHub

@connor4312 is already working on this.

Since Jan 17, 2023.

bug info-needed
Dominant language
TypeScript
Stars
2k
Forks
373
Avg merge
1d 9m
Merged PRs (30d)
6

Description

Describe the bug
If starting debugger with launch config when chrome is running, vscode tries to attach instead of launch.

To Reproduce
Steps to reproduce the behavior:

  1. Open Google Chrome.
  2. Open vscode.
  3. Run react project (CRA template) on terminal.
  4. Start debugging on vscode (press f5).
  5. See error "Unable to attach to browser".

launch.json file:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Launch Chrome",
      "type": "chrome",
      "request": "launch",
      "url": "http://localhost:3000",
      "webRoot": "${workspaceFolder}/src",
      "sourceMapPathOverrides": {
        "webpack:///src/*": "${webRoot}/*"
      },
    }
  ]
}

Log File
vscode-debugadapter-3d518fcb.json.gz

VS Code Version:
vscode 1.74.3

Additional context
Debugger extension used: vscode-js-debug v1.74.1
Google chrome version: 109.0.5414.75

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.