-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
needs triageThis issue needs to be triaged by the teamThis issue needs to be triaged by the team
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
14.0.1
Description
Caused by #25088
This line fails during Karma testing because the observe call before it returns undefined
Stack trace:
TypeError: Cannot read properties of undefined (reading 'subscribe')
at new HighContrastModeDetector (node_modules/@angular/cdk/fesm2020/a11y.mjs:2348:40)
at Object.factory (node_modules/@angular/cdk/fesm2020/a11y.mjs:2406:1)
at R3Injector.hydrate (node_modules/@angular/core/fesm2020/core.mjs:9258:35)
at R3Injector.get (node_modules/@angular/core/fesm2020/core.mjs:9146:33)
at injectInjectorOnly (node_modules/@angular/core/fesm2020/core.mjs:4778:33)
at Module.ɵɵinject (node_modules/@angular/core/fesm2020/core.mjs:4782:12)
at Object.useFactory (node_modules/@angular/material/fesm2020/core.mjs:105:1)
at Object.factory (node_modules/@angular/core/fesm2020/core.mjs:9345:38)
at R3Injector.hydrate (node_modules/@angular/core/fesm2020/core.mjs:9258:35)
at R3Injector.get (node_modules/@angular/core/fesm2020/core.mjs:9146:33)
Reproduction
I'm unsure how to completely reproduce, and I'm unable to share the code due to NDA.
Expected Behavior
HighContrastModeDetector successfully constructs
Actual Behavior
Constructor fails on only 2 of my components at the line linked above due to the expected Observable being undefined.
Environment
- Angular: Fails on 14.0.2, 14.1.3, and 14.2.0-rc.0
- CDK/Material: CDK
- Browser(s): Chrome Headless Karma/Jasmine
- Operating System (e.g. Windows, macOS, Ubuntu): Amazon Linux 2
DmitryEfimenko
Metadata
Metadata
Assignees
Labels
needs triageThis issue needs to be triaged by the teamThis issue needs to be triaged by the team