[Ivy - 9.0.0-rc1] Random R3InjectorError error while testing projects
See original GitHub issue🐞 bug report
Affected Package
The issue is caused by package @angular/....Is this a regression?
With Angular 8 and ViewEngine tests run fine.
Description
Every now and then when I run ng test
for all the projects in the workspace I randomly get the following error:
NullInjectorError: R3InjectorError(DynamicTestModule)[ApplicationInitStatus -> ApplicationInitStatus]:
Error appears in 5/10 cases, which makes it very hard to reproduce.
🔬 Minimal Reproduction
I am still struggling with pinning down what exactly causes this issue. I do not have the exact reproduction yet, but will update this question as soon as I find out, but maybe someone in the community has the same issue.
🔥 Exception or Error
11% building 16/16 modules 0 active12 11 2019 13:19:39.819:WARN [karma]: No captured browser, open http://localhost:9876/
12 11 2019 13:19:39.904:INFO [karma-server]: Karma v4.0.1 server started at http://0.0.0.0:9876/
12 11 2019 13:19:39.904:INFO [launcher]: Launching browsers ChromeHeadless with concurrency unlimited
12 11 2019 13:19:39.930:INFO [launcher]: Starting browser ChromeHeadless
12 11 2019 13:19:44.886:WARN [karma]: No captured browser, open http://localhost:9876/
12 11 2019 13:19:44.927:INFO [HeadlessChrome 78.0.3904 (Mac OS X 10.14.6)]: Connected on socket eY5cp4fpj7oZSNYnAAAA with id 81970510
HeadlessChrome 78.0.3904 (Mac OS X 10.14.6) SearchService should be created FAILED
NullInjectorError: R3InjectorError(DynamicTestModule)[ApplicationInitStatus -> ApplicationInitStatus]:
NullInjectorError: No provider for ApplicationInitStatus!
error properties: Object({ ngTempTokenPath: null, ngTokenPath: [ 'ApplicationInitStatus', 'ApplicationInitStatus' ] })
at <Jasmine>
at NullInjector.get (http://localhost:9876/path-to-project/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:895:1)
at R3Injector.get (http://localhost:9876/path-to-project/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:18046:1)
at R3Injector.get (http://localhost:9876/path-to-project/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:18046:1)
at NgModuleRef$1.get (http://localhost:9876/path-to-project/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:35741:1)
at R3TestBedCompiler.finalize (http://localhost:9876/path-to-project/node_modules/@angular/core/__ivy_ngcc__/fesm2015/testing.js:1979:24)
at TestBedRender3.get testModuleRef [as testModuleRef] (http://localhost:9876/path-to-project/node_modules/@angular/core/__ivy_ngcc__/fesm2015/testing.js:3299:1)
at TestBedRender3.inject (http://localhost:9876/path-to-project/node_modules/@angular/core/__ivy_ngcc__/fesm2015/testing.js:3160:1)
at Function.inject (http://localhost:9876/path-to-project/node_modules/@angular/core/__ivy_ngcc__/fesm2015/testing.js:3045:1)
at UserContext.<anonymous> (http://localhost:9876/_karma_webpack_/src/lib/example.service.spec.ts:9:44)
at ZoneDelegate.invoke (http://localhost:9876/path-to-project/node_modules/zone.js/dist/zone-evergreen.js:365:1)
HeadlessChrome 78.0.3904 (Mac OS X 10.14.6): Executed 1 of 26 (1 FAILED) (0 secs / 0.011 secs)
🌍 Your Environment
Angular Version: Angular CLI: 9.0.0-rc.1 Node: 10.17.0 OS: darwin x64 Angular: 9.0.0-rc.1 … animations, cli, common, compiler, compiler-cli, core, forms … language-service, platform-browser, platform-browser-dynamic … router, service-worker
Package Version
@angular-devkit/architect 0.900.0-rc.1 @angular-devkit/build-angular 0.900.0-rc.1 @angular-devkit/build-ng-packagr 0.900.0-rc.1 @angular-devkit/build-optimizer 0.900.0-rc.1 @angular-devkit/build-webpack 0.900.0-rc.1 @angular-devkit/core 9.0.0-rc.1 @angular-devkit/schematics 9.0.0-rc.1 @angular/cdk 9.0.0-rc.0 @angular/flex-layout 8.0.0-beta.27 @angular/localize 9.0.0-rc.0 @angular/material 9.0.0-rc.0 @angular/pwa 0.900.0-rc.1 @ngtools/webpack 9.0.0-rc.1 @schematics/angular 9.0.0-rc.1 @schematics/update 0.900.0-rc.1 ng-packagr 5.7.1 rxjs 6.5.3 typescript 3.6.4 webpack 4.41.2
Anything else relevant?
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (10 by maintainers)
this might have been fixed already, please test with rc.2 (due tomorrow) and if the issue still exists please provide steps to reproduce this.
@klemenoslaj Thanks for the report! Let us know when you have a repro so we can look into this