angular-material-components: error TS2420: Class 'NgxMatDatetimePicker' incorrectly implements interface 'CanColor'.

I am trying to do โ€œng buildโ€ or โ€œng serveโ€

Steps I have tried:

  • Deleted node_modules and reinstalled through npm.
    
  • Performed "npm update".
    
  • Ran "npm install --save @angular/cdk"
    

I am facing the below error. Please, help me on this.

ERROR in node_modules/@angular-material-components/datetime-picker/lib/datetime-picker.component.d.ts:52:22 - error TS2420: Class 'NgxMatDatetimePicker<D>' incorrectly implements interface 'CanColor'.
  Property 'defaultColor' is missing in type 'NgxMatDatetimePicker<D>' but required in type 'CanColor'.

52 export declare class NgxMatDatetimePicker<D> implements OnDestroy, CanColor {
                        ~~~~~~~~~~~~~~~~~~~~

  node_modules/@angular/material/core/common-behaviors/color.d.ts:15:5
    15     defaultColor: ThemePalette | undefined;
           ~~~~~~~~~~~~
    'defaultColor' is declared here.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 15 (1 by maintainers)

Most upvoted comments

Hello, here are the same issue ๐Ÿ˜‰ : https://github.com/h2qutc/angular-material-components/issues/104

We encounter trouble to use angular-material-component with @angular/material > 10.1.3

and someone suggested a fix here : https://github.com/h2qutc/angular-material-components/pull/105 ๐Ÿ˜‰ but the fix hasnโ€™t been released yet

@h2qutc if you have some time to take a look at this please ๐Ÿ˜ƒ

Same problem here. Downgraded: โ€œ@angular/materialโ€: โ€œ10.2.0โ€ --> โ€œ10.1.3โ€. Seems to work for me.

Hi All, a new version 4.0.3 of @angular-material-components/datetime-picker has already been released to fix this issue. Please check it out. Thanks.