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:
.ts file where the breakpoint, in theory, should be boundng serve -c ENVIRONMENTN/A
2020.10.2217
launch.json configuration:{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}"
}
]
}
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"
}
]
},
1.50.183.0.4103.1224.12.112020.10.2217I 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! :)