几天前,我无法在Visual Studio Code中使用Angular的Chrome Debugger扩展程序正确调试我的任何项目。如果我在一行代码中设置一个断点,它会在一个完全不同的行中断,而且,我必须在第一次刷新页面才能使它工作!
以下是我使用的版本:
Angular CLI版本:1.7.4
Visual Studio版本:1.22.1
这是我的launch.json
,并且这几个月都在使用这个配置,我记得唯一改变的是Visual Studio Code中的更新从1.21到1.22,但我回滚到1.21仍然问题在那里,是否有人遇到过这些问题?
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome against localhost, with sourcemaps",
"type": "chrome",
"request": "launch",
"url": "http://localhost:4200",
"sourceMaps": true,
"trace": true,
"webRoot": "${workspaceRoot}/src",
"userDataDir": "${workspaceRoot}/.vscode/chrome",
"sourceMapPathOverrides": {
"webpack:///*":"/*"
}
},
{
"name": "Attach to Chrome, with sourcemaps",
"type": "chrome",
"request": "attach",
"port": 9222,
"sourceMaps": true,
/*"diagnosticLogging": true,*/
"webRoot": "${workspaceRoot}",
"url": "http://localhost:4200/*",
"sourceMapPathOverrides": {
"webpack:///*": "/*"
}
}
]
}