-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(CDK_TABLE): "NullInjectorError: No provider for InjectionToken CDK_TABLE!" after upgrade of cdk to 17.1.0 #28626
Comments
Resolved: Adding
to the table class and <ng-container headerRowOutlet></ng-container>
<ng-container rowOutlet></ng-container>
<ng-container noDataRowOutlet></ng-container>
<ng-container footerRowOutlet></ng-container> to
|
This is very weird: @if (!_isNativeHtmlTable) {
<ng-container headerRowOutlet />
<ng-container rowOutlet />
<ng-container noDataRowOutlet />
<ng-container footerRowOutlet />
} renders the table without issues, <ng-container headerRowOutlet />
<ng-container rowOutlet />
<ng-container noDataRowOutlet />
<ng-container footerRowOutlet /> does not... Is there perhaps something magical timings going on with the _isNativeHtmlTable property? |
The error should be fixed by #28551 in the 17.2.0 release. |
Ahh great! :D Thanks @crisbeto |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Is this a regression?
The previous version in which this bug was not present was
@angular/cdk: 17.0.4
Description
Hi, we have a pretty large codebase with a custom table class
TableComponent
that extends CdkTable.I am now trying to bump our angular stack but this fails at runtime.
These are some of the package changes.
I have a sneaking suspicion that this "bug" was introduced with #28356
Looking for help as to how to resolve this
Reproduction
I don't really know if this is a bug or if our implementation has been wrong, but this worked in the last version
StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-hj5acn?file=package.json
Steps to reproduce:
NullInjectorError: No provider for InjectionToken CDK_TABLE!
error message in the consoleNB: this is not an optimal repro, since on 17.0.4, there is another error which I have not encountered in our app
Expected Behavior
The tables are showing as they did in the latest version
Actual Behavior
When starting the application, I get the error
NullInjectorError: No provider for InjectionToken CDK_TABLE!
I have tried adding the
{provider:CDK_TABLE, useClass: CdkTable}
to ourTableComponent
, and then it fails withEnvironment
Angular CLI: 17.0.8
Node: 18.13.0
Package Manager: yarn 3.4.1
OS: win32 x64
Angular: 17.1.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
@angular-devkit/architect 0.1701.4
@angular-devkit/build-angular 17.1.4
@angular-devkit/core 17.1.4
@angular-devkit/schematics 17.1.4
@angular/cdk 17.1.2
@angular/cli 17.0.8
@angular/material 17.1.2
@angular/material-moment-adapter 17.1.2
@schematics/angular 17.1.4
rxjs 7.8.1
typescript 5.3.3
webpack 5.88.2
zone.js 0.14.4
The text was updated successfully, but these errors were encountered: