Vscode-js-debug: Unbound breakpoint in VS Code when serving a different configuration

Created on 1 Dec 2020  路  3Comments  路  Source: microsoft/vscode-js-debug

Describe the bug

My issue

I have an Angular application that I am trying to debug in VS Code.

Currently when I serve the application e.g. ng serve my breakpoints are bound and the breakpoints get hit:

enter image description here

However, when I serve via a different configuration e.g. ng serve -c qa or ng serve -c uat the breakpoints become unbound:

enter image description here

Is there a reason why the breakpoints become unbound? How can I get the breakpoints to hit when serving with different environment configurations?

To Reproduce
Steps to reproduce the behavior:

  1. Set a breakpoint in a .ts file where the breakpoint, in theory, should be bound
  2. ng serve -c ENVIRONMENT
  3. Observe that the breakpoint becomes unbound

Log File

N/A

VS Code Version:

2020.10.2217

Additional context

launch.json configuration:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "Launch Chrome against localhost",
      "url": "http://localhost:4200",
      "webRoot": "${workspaceFolder}"
    }
  ]
}

Sample environment configuration angular.json:

"uat": {
  "fileReplacements": [
    {
      "replace": "src/environments/environment.ts",
      "with": "src/environments/environment.uat.ts"
    }
  ],
  "optimization": true,
  "outputHashing": "all",
  "sourceMap": false,
  "extractCss": true,
  "namedChunks": false,
  "extractLicenses": false,
  "vendorChunk": false,
  "buildOptimizer": true,
  "budgets": [
    {
      "type": "initial",
      "maximumWarning": "2mb",
      "maximumError": "5mb"
    },
    {
      "type": "anyComponentStyle",
      "maximumWarning": "6kb",
      "maximumError": "10kb"
    }
  ]
},

Software versioning:

*question

All 3 comments

I see that you have "sourceMap": false,. Without sourcemaps we cannot map source location to their compiled locations, or vise versa. Let us know if you have any other issues.

Thanks, I should have spotted that, sorry to waste your time.

Thanks for asking the question. It saved time for me! :)

Was this page helpful?
0 / 5 - 0 ratings