Skip to content
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]error NG2016: The component xxx inherits its constructor from CdkVirtualScrollViewport , but the latter has a constructor parameter that is not compatible with dependency injection. Either add an explicit constructor to xxx or change CdkVirtualScrollViewport's constructor to use parameters that are valid for DI. #48251

Closed
lamianbu opened this issue Nov 28, 2022 · 2 comments

Comments

@lamianbu
Copy link

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

Yes

Description

A comp extends CdkVirtualScrollViewport, build success with angular@14, but build fail with angular@15

The comp with no constructor, so should not show this ERROR:

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

× Compiling with Angular sources in Ivy partial compilation mode.
@cloud/tiny3/components/table/TiTableVirtualScrollViewportComponent.ts:34:14 - error NG2016: The component TiTableVirtualScrollViewportComponent inherits its constructor from CdkVirtualScrollViewport, but the latter has a constructor parameter that is not compatible with dependency injection. Either add an explicit constructor to TiTableVirtualScrollViewportComponent or change CdkVirtualScrollViewport's constructor to use parameters that are valid for DI.

34 export class TiTableVirtualScrollViewportComponent extends CdkVirtualScrollViewport implements OnInit {

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 15.0.1
Node: 16.17.0
Package Manager: npm 8.15.0
OS: win32 x64

Angular: 15.0.1
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1500.1
@angular-devkit/build-angular   15.0.1
@angular-devkit/core            15.0.1
@angular-devkit/schematics      15.0.1
@angular/cdk                    15.0.0
@schematics/angular             15.0.1
ng-packagr                      15.0.1
rxjs                            7.4.0
typescript                      4.8.4

Anything else?

Maybe this is a specific example:

#48152

@JoostK
Copy link
Member

JoostK commented Nov 28, 2022

Yep, duplicate of #48152 and will be fixed in the next patch release.

@JoostK JoostK closed this as not planned Won't fix, can't repro, duplicate, stale Nov 28, 2022
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants