-
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
tabs(ivy): ivy-ngcc can't handle Inputs from an abstract class w/o a decorator like _MatTabGroupBase #17121
Comments
@Splaktar Thank you sir. Previously i was not getting any error in this but i updated all my packages to latest then suddenly i got this error. |
@ErVishalM can you please provide the versions that you were at before? |
@Splaktar I'm sorry buddy but is there any command to check previous version? But I remember it was not that much old because I update angular packages on daily basis. But I can give you my other machine package.json file in which I keep backup and in that version it is working fine but it may not be the last version I had because it's been 10-12 days I did not take backup of my project. |
Hi @Splaktar I've found the previous version file please check my package.json file. In this it was working fine.
|
@Splaktar any update on this issue? |
Do you have or can you create a repository for us to reproduce and debug this issue? |
@Splaktar I am sorry i dont know how to upload to github or any other website but yeah I have added project in my google drive and you can access it and |
@ErVishalM is it OK if I post it on GitHub so that I can link to parts of the code for discussion? |
@Splaktar yes Sir of course. Actually i did not know the process to do that, that is why i could not do that. |
OK, I did some minor refactoring since the project wasn't fully migrated to the Angular CLI version 8 format. But that wasn't causing this issue. I also reverted to Angular Material |
If I disable Ivy here, then it builds just fine. |
Updating to Angular ERROR - error TS8002: 'selectedIndex' is not a valid property of <mat-tab-group>.
25 <mat-tab-group [selectedIndex]="1"
~~~~~~~~~~~~~~~~~~~ |
With Ivy enabled, this still fails back to Angular Material |
Note that using Angular Material ERROR TypeError: Cannot read property 'nativeElement' of undefined
at MatTabGroup._removeTabBodyWrapperHeight (tabs.js:1809)
at MatTabGroup_mat_tab_body_5_Template_mat_tab_body__onCentered_0_listener (tabs.js:119)
at executeListenerWithErrorHandling (core.js:22181)
at wrapListenerIn_markDirtyAndPreventDefault (core.js:22216)
at core.js:35373
at ZoneDelegate.invokeTask (zone-evergreen.js:391)
at Object.onInvokeTask (core.js:39687)
at ZoneDelegate.invokeTask (zone-evergreen.js:390)
at Zone.runTask (zone-evergreen.js:168)
at invokeTask (zone-evergreen.js:465)
at ZoneTask.invoke (zone-evergreen.js:454)
at timer (zone-evergreen.js:2650)
core.js:6014 ERROR TypeError: Cannot read property 'nativeElement' of undefined
at MatTabHeader._checkPaginationEnabled (tabs.js:1272)
at MatTabHeader.updatePagination (tabs.js:1083)
at MatTabHeader.ngAfterContentChecked (tabs.js:942)
at callHook (core.js:3097)
at callHooks (core.js:3057)
at executeHooks (core.js:3008)
at refreshDescendantViews (core.js:11742)
at checkView (core.js:13616)
at componentRefresh (core.js:13359)
at refreshChildComponents (core.js:11858)
at refreshDescendantViews (core.js:11757)
at checkView (core.js:13616)
at componentRefresh (core.js:13359)
at refreshChildComponents (core.js:11858)
at refreshDescendantViews (core.js:11757) |
Note that this affects other ERROR in src/app/lib/tabs/tabs.component.ts(25,24): Property 'dynamicHeight' does not exist on type 'HTMLElement'. If you don't use data binding, it doesn't fail to build selectedIndex="0" dynamicHeight="true" But if you do, it fails: [selectedIndex]="selectedControl.value" [dynamicHeight]="'true'" ERROR in src/app/lib/tabs/tabs.component.ts(25,24): Property 'selectedIndex' does not exist on type 'HTMLElement'.
src/app/lib/tabs/tabs.component.ts(25,64): Property 'dynamicHeight' does not exist on type 'HTMLElement'. |
@Splaktar how did you know it's not migrated correctly, May I know. And about this issue, this will be fix right? |
@ErVishalM see this commit for related changes:
Yes, we've identified the issue and will work on a fix or submit a bug to |
Not migrated completely that is also a mistake. I saw from here how to upgrade from 7 to 8. What there is mentioned I did everything but it was incomplete 😥 |
@ErVishalM it looks like you either didn't run |
If this is the only command |
@ErVishalM what you can do is |
As for debugging this issue, none of the static ngComponentDef: ɵngcc0.ɵɵComponentDefWithMeta<MatTabGroup, "mat-tab-group", ["matTabGroup"], { 'color': "color", 'disableRipple': "disableRipple" }, {}, ["_tabs"]>; So this looks like an issue with |
The associated
There also appear to be some related errors mentioned in angular/angular#32466 (comment). sebholstein/angular-google-maps#1647 (comment) mentions that the issue could be related to the way that decorators are emitted. |
@Splaktar I don't think those are indeed the cause for this issue, but rather it's angular/angular#30080. The |
Originally it looked like components/src/material/tabs/tab-group.ts Lines 99 to 137 in 492fdcc
But now it is looking more like this could be due to components/src/material/tabs/tab-group.ts Line 363 in 492fdcc
|
It looks like we need to add something similar to the following for each Abstract Base Class that includes any kind of Decorator: @Directive({selector: 'mat-tab-group-base'}) We can't use empty selectors (i.e. Angular Flex Layout had to do something similar in angular/flex-layout#1114 for Ivy support. Ideally, this would be fixed in |
Adding that causes the following build error: Cannot determine the module for class _MatTabGroupBase in /Users/splaktar/Git/angular/material2/src/material/tabs/tab-group.ts! Add _MatTabGroupBase to the NgModule to fix it. Adding that to declarations: [
_MatTabGroupBase, Causes this build error: tabs-module.ts(26,11): error TS2345: Argument of type '{ imports: (typeof CommonModule | typeof MatCommonModule)[]; exports: (typeof MatTabContent | typeof MatTabLabel | typeof MatTab | typeof MatTabGroup | typeof MatTabNav | typeof MatTabLink | typeof MatCommonModule)[]; declarations: (typeof MatTabContent | ... 9 more ... | typeof MatTabHeader)[]; }' is not assignable to parameter of type 'NgModule'.
Types of property 'declarations' are incompatible.
Type '(typeof MatTabContent | typeof MatTabLabel | typeof MatTab | typeof _MatTabGroupBase | typeof MatInkBar | typeof MatTabLabelWrapper | typeof MatTabNav | typeof MatTabLink | typeof MatTabBodyPortal | typeof MatTabBody | typeof MatTabHeader)[]' is not assignable to type '(any[] | Type<any>)[]'.
Type 'typeof MatTabContent | typeof MatTabLabel | typeof MatTab | typeof _MatTabGroupBase | typeof MatInkBar | typeof MatTabLabelWrapper | typeof MatTabNav | typeof MatTabLink | typeof MatTabBodyPortal | typeof MatTabBody | typeof MatTabHeader' is not assignable to type 'any[] | Type<any>'.
Type 'typeof _MatTabGroupBase' is not assignable to type 'any[] | Type<any>'.
Type 'typeof _MatTabGroupBase' is not assignable to type 'Type<any>'.
Cannot assign an abstract constructor type to a non-abstract constructor type. |
Along the same lines as angular#17022. Adds annotations to the various base classes that declare inputs, because the Ivy template type checker doesn't handle base defs at the moment. Fixes angular#17121.
Based on PR #17022 and PR #17228, it looks like you would actually need to either
It also looks like @jelbourn wants these module and selector names prepended with It looks like the combination of those 2 PRs should fix these issues for Angular Material w/ Ivy. |
@SerkanSipahi I believe that this can be fixed in Angular Material 8.2.x. |
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. |
Hi,
I am getting this error after upgrade in current cli in mat-tab-group.
Property 'selectedIndex' does not exist on type 'HTMLElement'
Example picking from Angular Website and run after the upgrade to latest then getting this error previously it was not giving any error.
HTML Code is -
Component Code is-
Package.json is
The text was updated successfully, but these errors were encountered: