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 Debugger 插件来调试 Angular 应用程序.升级使用 angular/cli@1.7.0 后,我们在调试时无法再在 VS Code 中的 typescript 代码中打断点.如果我们回滚到 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
还有其他人遇到这种情况吗?
Is anyone else experiencing this?
推荐答案
对于那些遇到此问题的人,修复方法是修改您的 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屋!