Components: Bug: Generic type 'CdkRowDef<T>' requires 1 type argument(s)

Created on 6 Oct 2017  路  6Comments  路  Source: angular/components

Bug:

After updating from 2.0.0-beta.11 to 2.0.0-beta.12, when running my project I get the following errors:
node_modules/@angular/material/table/typings/row.d.ts (20,39): Generic type 'CdkRowDef<T>' requires 1 type argument(s)
node_modules/@angular/material/table/typings/row.d.ts (23,40): Generic type 'CdkRowDef<T>' requires 1 type argument(s)

If I change both lines from:
export declare class MdRowDef extends _MdCdkRowDef { }

export declare class MatRowDef extends _MdCdkRowDef { }

To:
export declare class MdRowDef extends _MdCdkRowDef<any> { }

export declare class MatRowDef extends _MdCdkRowDef<any> { }

I can run my project again with no issues.
I don't use the table module but was wondering if this is the correct way to solve the issue.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 4.4.3, Material 2.0.0-beta.12, macOs Sierra, TypeScript 2.5.2, no browser affected.

Most helpful comment

Check you have pinned the same version of cdk and material in package.json:

  "dependencies": {
...
    "@angular/cdk": "2.0.0-beta.11",
    "@angular/material": "2.0.0-beta.11",
}

If you have e.g. ^2.0.0-beta.11 for cdk, you will run into problems now that beta.12 is available.

All 6 comments

A mismatch in angular cdk and angular material gave me this error. It worked for me when i got both the versions same at 11 ( @angular/material 2.0.0.-beta.11 and @angular/cdk 2.0.0-beta.11.) When i tried with version 12, build breaks.

if you're looking for a quick fix until you reinstall the node package with the matching versions you can simply alter the type to any:

in the angular material src file row.d.ts

export declare class MdRowDef extends _MdCdkRowDef<any> {
}
/** Mat-compatible version of MdRowDef */
export declare class MatRowDef extends _MdCdkRowDef<any> {
}

Check you have pinned the same version of cdk and material in package.json:

  "dependencies": {
...
    "@angular/cdk": "2.0.0-beta.11",
    "@angular/material": "2.0.0-beta.11",
}

If you have e.g. ^2.0.0-beta.11 for cdk, you will run into problems now that beta.12 is available.

Sounds like the issue is due to mismatched versions, if the problem persists then please feel free to re-open the issue

Had the same problem, when I have put same versions, worked fine.

@shuckc +1

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alanpurple picture alanpurple  路  3Comments

Miiekeee picture Miiekeee  路  3Comments

3mp3ri0r picture 3mp3ri0r  路  3Comments

julianobrasil picture julianobrasil  路  3Comments

vanor89 picture vanor89  路  3Comments