我在让Visual代码的Microsoft工具的"自动附加调试器“特性开始工作时遇到了一些问题。
我生成了一个新的角项目(ng new),并添加了这个launch.json配置
{
"configurations": [
// this one works. It opens a chrome window and hits my break points.
{
"type": "pwa-chrome", // this is not "Microsoft Edge Developer Tools for Visual Studio Code"
"name": "http://localhost:4200/",
"request": "launch",
"url": "http://localhost:4200/"
},
// this one does not work. It opens a headless edge window, but it does not hit my break points.
{
"type": "vscode-edge-devtools.debug", // this is "Microsoft Edge Developer Tools for Visual Studio Code"
"request": "launch",
"name": "Launch Microsoft Edge and open the Edge DevTools",
"url": "http://localhost:4200/",
"webRoot": "${workspaceFolder}"
}
]
}我有这些扩展设置
{
"vscode-edge-devtools.enableNetwork": true,
"vscode-edge-devtools.headless": true,
"vscode-edge-devtools.defaultUrl": "http://localhost:4200/"
}

我试着摆弄sourceMapPathOverrides,但我似乎搞错了。
webpack:///内容如下所示

发布于 2022-06-27 20:12:45
我也有过类似的问题。我的问题是,在我的sourceMap文件中没有显式启用tsconfig.json:
{
"compileOnSave": false,
"compilerOptions": {
///....
"sourceMap": true
}
}我还必须在angular.json文件中启用它,如下所示:
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
///...
"hmr": {
"sourceMap": true, <= for me since I'm using hmr here
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.hmr.ts"
}
]
},
"development": {
"sourceMap": true <= and here
}
}
},https://stackoverflow.com/questions/66258560
复制相似问题