Angular CLI 1.7.0和Visual Studio Code-无法设置断点 [英] Angular CLI 1.7.0 and Visual Studio Code - can't set breakpoints
问题描述
我正在使用Visual Studio Code中的Chrome调试器插件调试Angular应用程序.升级为使用angular/cli@1.7.0后,在调试时我们将无法再在VS Code中的打字稿代码中命中断点.如果我们回滚到angular/cli@1.6.7,则断点将重新开始工作.
I'm using the Chrome Debugger plugin in Visual Studio Code to debug an Angular application. After upgrading to use angular/cli@1.7.0, we can no longer hit breakpoints in the typescript code within VS Code while debugging. If we roll back to angular/cli@1.6.7, breakpoints start working again.
这是我的ng -v输出:
Here's my ng -v output:
Angular CLI: 1.7.0
Node: 9.2.0
OS: win32 x64
Angular: 5.2.5
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cli: 1.7.0
@angular-devkit/build-optimizer: 0.3.1
@angular-devkit/core: 0.3.1
@angular-devkit/schematics: 0.3.1
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.0
@schematics/angular: 0.3.1
@schematics/package-update: 0.3.1
typescript: 2.5.3
webpack: 3.11.0
还有其他人遇到过吗?
推荐答案
对于遇到此问题的人,解决方法是按如下所示修改您的launch.json sourceMapPathOverrides:
For those coming across this the fix is to modify your launch.json sourceMapPathOverrides as follows:
"sourceMapPathOverrides": {
"webpack:/*": "${webRoot}/*"
}
这通过最新的@ angular/cli(版本1.7.3)为我修复了该问题.
This fixed it for me with the latest @angular/cli (version 1.7.3).
在此处找到答案.
这篇关于Angular CLI 1.7.0和Visual Studio Code-无法设置断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!