Angular 8 和 9 升级后 WebStorm 断点不会暂停

WebStorm breakpoints not pausing after Angular 8 and 9 upgrade

问题

我们有一个带有共享库的 Angular 7.2 CLI 多项目应用程序。我们升级到 Angular 8,然后升级到 Angular 9。升级到 Angular 8 后,在使用共享库的项目中调试时,WebStorm 不再在断点处暂停。库中不依赖于其他项目的断点总是按预期暂停。

到目前为止我们尝试了什么

我们一次升级一个项目多次,直到我们确定问题在我们升级 @angular/core 时开始,这也升级了打字稿。然后,我们按照此处的 Angular 说明使用 CLI 从头开始​​创建了一个新的多项目应用程序:https://angular.io/guide/file-structure We setup two libraries. common and common-child. We added a test in common-child that imports a util class from common. The test in common will pause on breakpoints but the test in common-child will not. We have uploaded this repo here: https://github.com/chef55555/debug-issue

我们的环境

重现步骤

如果我删除或注释掉 projects/common-child/src/lib/child.spec.ts 中的第 1 行和第 5 行,则断点将暂停。 有时我必须重新启动 Karma 服务器才能让断点在进行此更改后暂停。

导入共享库文件有两种方法,使用直接导入like

import { SharedUtil } from '../../../common/src/lib/shared/shared.util';

或在 tsconfig 中设置一个“路径”条目,然后像这样引用已编译的库

import { SharedUtil } from 'common';

我们发现,当我们使用第一种导入方式时,断点仍然会暂停,但是当我们使用第二种导入方式时,断点不会。我们在实际项目中广泛使用这种导入共享库的方式。

根本原因

所有这些让我们相信 WebStorm 中存在一些问题,调试在 Angular 8 或更高版本上使用本地共享库的项目。

有什么想法吗?

问题已在 WEB-44080 跟踪,请关注它(和链接的工单)以获取更新