angular - 为什么 Angular 8 更新后 vs19 中的断点停止工作?
问题描述
总结: 我昨天刚刚使用 angular cli 和 ng update 命令将我的 angular webproject 从版本 7.2.15 更新到 8.1.2。但是现在如果我尝试调试我的打字稿代码,突然断点在 Visual Studio 社区 2019 中不再起作用?
所以当我激活一个断点时,断点会变成白色并显示一个标签文本,上面写着:断点已设置但尚未绑定。
我已经尝试过: 使用谷歌时,我发现其他用户也有类似的问题,他们通过在 tsconfig.json 中进行设置解决了这个问题。
"sourceMap": true
对我来说不幸的是,这并没有改变任何东西,因为我的 tsconfig.json 已经将属性 sourceMap 设置为 true 但断点仍然不会被命中。
我的猜测是角度更新在某种程度上覆盖了某些文件中的某些设置,我完全不知道。
显示一些代码: 查看我提交的比较,我注意到在 tsconfig.json 和 package.json 文件中,许多其他内容也发生了变化,例如:
tsconfig.json
+ "downlevelIteration": true,
- "module": "es2015",
+ "module": "esnext",
- "target": "es5",
+ "target": "es2015",
包.json:
- "@angular-devkit/build-angular": "^0.12.4",
+ "@angular-devkit/build-angular": "~0.801.1",
- "codelyzer": "~4.5.0",
+ "codelyzer": "^5.0.1",
- "zone.js": "~0.8.29"
+ "zone.js": "~0.9.1"
- "typescript": "3.1.6"
+ "typescript": "3.4.5"
tslint.json:
- "use-input-property-decorator": true,
- "use-output-property-decorator": true,
- "use-host-property-decorator": true,
+ "no-inputs-metadata-property": true,
+ "no-outputs-metadata-property": true,
+ "no-host-metadata-property": true,
预期的结果/行为:预期会遇到断点,这样我就可以看到我的代码中发生了什么。但正如所说,断点只是变白,不会被绑定。
最后一个问题:所以我最后的问题是:如何在 Angular 8 更新后让断点在 VS2019 中再次工作?
(21.07.2019) 编辑 1:同时我还尝试删除 ClientApp 文件夹中的“node_modules”文件夹,然后使用 npm install 重新安装。不幸的是,断点仍然不会被击中。
(22.07.2019)编辑 2“这不能解决吗?” :似乎将角度恢复到版本 7.2.15 已经修复了断点问题,我可以再次查看我的断点。尽管我对这种方法不太满意,因为更新到当前版本会很棒。关于这个问题,我还在官方@angular/cli 中心的 github 上打开了一个案例。如果有人有更好的解决方案从@7.2.15 升级到@latest stable,我将保持开放状态。
谢谢
解决方案
将“@angular-devkit/build-angular”:“0.801.2”更改为“@angular-devkit/build-angular”:“0.801.0”
推荐阅读
- linux - 有什么方法可以访问 .couch 文件以及在 couchdb 文件上设置的其他所有者和组?
- flutter - Flutter:为什么内容替换List中的值而不是添加到List中?
- c# - LINQ 查询结果中的奇怪值
- python - TypeError:调用 pd.to_numeric 时字符串索引必须是整数
- swift - 转动手腕时流暂停 - watchOS / Swift
- algorithm - 筏领导选举算法中的TermId?
- android - 为什么 gradle 不实现 com.android.support:design:28.0.0 来添加 TextInputLayout?
- jquery - 如何将 txt 数据作为选项值和选项标记填充到选择标记中
- python - 根据分隔符拆分字符串列并为 Pyspark 中的每个值创建列
- spring - 使用由资源服务器客户端密钥和秘密生成的令牌授予对资源服务器的访问权限 - Spring boot