7
votes

While doing "ng build", I am facing the below errors.

ERROR in node_modules/@angular-material-components/datetime-picker/lib/datetime-picker.component.d.ts:52:22 - error TS2420: Class 'NgxMatDatetimePicker' incorrectly implements interface 'CanColor'.

and

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

3
did downgrading solve your issue? - etarhan

3 Answers

5
votes

There appear to multiple recent github issues referencing the same problem: 1, 2. One of the comments state that downgrading to version @angular/material to version 10.1.3 seems to resolve the issue (see comment here) as a temporary workaround. In addition a fix seems to be in the works (see here), but hasn't yet been merged as of writing this.

For now your best bet is to fix the @angular/material version to 10.1.3

1
votes

I get the same errors after upgrading material to latest. I am using a different datepicker (saturn-datepicker) but the same apart from that.

1
votes

I solve this error by removing @angular/material 10.2.0 and install v 10.1.0

npm uninstal @angular/material
npm install @angular/[email protected]