Unbound breakpoint in VS Code when serving a different configuration
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:
However, when I serve via a different configuration e.g. ng serve -c qa or ng serve -c uat the breakpoints become unbound:
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:
- Set a breakpoint in a
.tsfile where the breakpoint, in theory, should be bound ng serve -c ENVIRONMENT- 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:
-
Visual Studio Code
1.50.1 -
Chrome
83.0.4103.122 -
Debugger for Chrome
4.12.11 -
JavaScript Debugger (Nightly)
2020.10.2217
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! :)
I am using Angular 15 and Node 18. I have the same issue but my "sourceMap" under development configuration is "true", yet breakpoints are unbound.
`"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "development"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "savings-app-osiris:build:production"
},
"development": {
"browserTarget": "savings-app-osiris:build:development"
}
},
"defaultConfiguration": "development"
}
}`
@Vitruvius21 I have the same issue
I have the same issue

