如果单击 Chrome 中的检查按钮,则在 Visual Studio 代码终端中收到 404: 警告消息
If click on inspect button in Chrome getting the 404: warning messages in the Visual Studio Code terminal
在进行 Angular 测试时,当我在终端中输入 ng test
命令时,我能够 运行 我的测试用例成功 window http://localhost:9876/ 也打开了我的测试用例,但是如果我单击 Chrome 中的检查按钮,我会收到这些警告消息 - 如何解决这个问题?
06 12 2018 13:24:33.458:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/takeUntil.js.map
06 12 2018 13:24:33.461:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/takeWhile.js.map
06 12 2018 13:24:33.462:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/throttle.js.map
06 12 2018 13:24:33.556:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/throttleTime.js.map
06 12 2018 13:24:33.568:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/timeInterval.js.map
06 12 2018 13:24:33.569:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/timeout.js.map
06 12 2018 13:24:33.573:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/timeoutWith.js.map
06 12 2018 13:24:33.576:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/timestamp.js.map
06 12 2018 13:24:33.578:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/toArray.js.map
06 12 2018 13:24:33.581:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/window.js.map
06 12 2018 13:24:33.585:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/windowCount.js.map
06 12 2018 13:24:33.586:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/windowTime.js.map
06 12 2018 13:24:33.587:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/windowToggle.js.map
06 12 2018 13:24:33.590:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/windowWhen.js.map
06 12 2018 13:24:33.594:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/withLatestFrom.js.map
06 12 2018 13:24:33.595:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/zip.js.map
06 12 2018 13:24:33.598:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/zipAll.js.map
06 12 2018 13:24:33.608:WARN [web-server]: 404: /node_modules/@angular/platform-browser-dynamic/fesm5/testing.js.map
06 12 2018 13:24:33.624:WARN [web-server]: 404: /node_modules/@angular/platform-browser/fesm5/platform-browser.js.map
06 12 2018 13:24:33.627:WARN [web-server]: 404: /node_modules/@angular/common/fesm5/common.js.map
06 12 2018 13:24:33.628:WARN [web-server]: 404: /node_modules/@angular/compiler/fesm5/compiler.js.map
06 12 2018 13:24:33.629:WARN [web-server]: 404: /node_modules/@angular/compiler/fesm5/testing.js.map
06 12 2018 13:24:33.630:WARN [web-server]: 404: /node_modules/@angular/platform-browser-dynamic/fesm5/platform-browser-dynamic.js.map
06 12 2018 13:24:33.668:WARN [web-server]: 404: /node_modules/@angular/platform-browser/fesm5/testing.js.map
06 12 2018 13:24:33.671:WARN [web-server]: 404: /node_modules/@angular/forms/fesm5/forms.js.map
发生这种情况是因为 Typescript 没有在 test 环境中生成 sourcemaps,以便更准确地反映 prod 环境并期望得到更精确的结果。
要解决此问题,运行 带有 --source-map
标志的命令:
ng test --source-map
在进行 Angular 测试时,当我在终端中输入 ng test
命令时,我能够 运行 我的测试用例成功 window http://localhost:9876/ 也打开了我的测试用例,但是如果我单击 Chrome 中的检查按钮,我会收到这些警告消息 - 如何解决这个问题?
06 12 2018 13:24:33.458:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/takeUntil.js.map
06 12 2018 13:24:33.461:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/takeWhile.js.map
06 12 2018 13:24:33.462:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/throttle.js.map
06 12 2018 13:24:33.556:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/throttleTime.js.map
06 12 2018 13:24:33.568:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/timeInterval.js.map
06 12 2018 13:24:33.569:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/timeout.js.map
06 12 2018 13:24:33.573:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/timeoutWith.js.map
06 12 2018 13:24:33.576:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/timestamp.js.map
06 12 2018 13:24:33.578:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/toArray.js.map
06 12 2018 13:24:33.581:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/window.js.map
06 12 2018 13:24:33.585:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/windowCount.js.map
06 12 2018 13:24:33.586:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/windowTime.js.map
06 12 2018 13:24:33.587:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/windowToggle.js.map
06 12 2018 13:24:33.590:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/windowWhen.js.map
06 12 2018 13:24:33.594:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/withLatestFrom.js.map
06 12 2018 13:24:33.595:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/zip.js.map
06 12 2018 13:24:33.598:WARN [web-server]: 404: /node_modules/rxjs/_esm5/internal/operators/zipAll.js.map
06 12 2018 13:24:33.608:WARN [web-server]: 404: /node_modules/@angular/platform-browser-dynamic/fesm5/testing.js.map
06 12 2018 13:24:33.624:WARN [web-server]: 404: /node_modules/@angular/platform-browser/fesm5/platform-browser.js.map
06 12 2018 13:24:33.627:WARN [web-server]: 404: /node_modules/@angular/common/fesm5/common.js.map
06 12 2018 13:24:33.628:WARN [web-server]: 404: /node_modules/@angular/compiler/fesm5/compiler.js.map
06 12 2018 13:24:33.629:WARN [web-server]: 404: /node_modules/@angular/compiler/fesm5/testing.js.map
06 12 2018 13:24:33.630:WARN [web-server]: 404: /node_modules/@angular/platform-browser-dynamic/fesm5/platform-browser-dynamic.js.map
06 12 2018 13:24:33.668:WARN [web-server]: 404: /node_modules/@angular/platform-browser/fesm5/testing.js.map
06 12 2018 13:24:33.671:WARN [web-server]: 404: /node_modules/@angular/forms/fesm5/forms.js.map
发生这种情况是因为 Typescript 没有在 test 环境中生成 sourcemaps,以便更准确地反映 prod 环境并期望得到更精确的结果。
要解决此问题,运行 带有 --source-map
标志的命令:
ng test --source-map