question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

18reactions
shuckccommented, Oct 6, 2017

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.

2reactions
ajitherecommented, Oct 6, 2017

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generic type requires 1 type argument(s), but only when ...
I wanted to extract this to its own type so I could reuse it in a different function, but it throws and error...
Read more >
"Generic type ' Example' requires 1 type argument(s)." ts(2314 ...
Bug Report Search Terms generic type ts 2314 .d.ts Version & Regression Information Versions I tried: I tried 3.3.3, ...
Read more >
Documentation - Generics - TypeScript
Here we explicitly set Type to be string as one of the arguments to the function ... as “the generic function loggingIdentity takes...
Read more >
Using Generic Type 'Action <T>' requires 1 type Argument ...
I added an existing item to my project an now I'm getting the error in the Title line. I added the .cs and...
Read more >
TypeScript Tidbits — Generic Type Parameter | by Richard Bell
A generic type parameter is a placeholder that we can use to enforce a type-level constraint in multiple places.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found