2

node_modules/@angular/material/core/option/optgroup.d.ts:17:22 - error TS2420: Class '_MatOptgroupBase' incorrectly implements interface 'CanDisable'. Property 'disabled' is missing in type '_MatOptgroupBase' but required in type 'CanDisable'.

17 export declare class _MatOptgroupBase extends _MatOptgroupMixinBase implements CanDisable {
                        ~~~~~~~~~~~~~~~~

  node_modules/@angular/material/core/common-behaviors/disabled.d.ts:12:5
    12     disabled: boolean;
           ~~~~~~~~
    'disabled' is declared here.
node_modules/@angular/material/button/button.d.ts:22:22 - [91merror TS2420: Class 'MatButton' incorrectly implements interface 'CanColor'.
  Type 'MatButton' is missing the following properties from type 'CanColor': color, defaultColor

22 export declare class MatButton extends _MatButtonMixinBase implements AfterViewInit, OnDestroy, CanDisable, CanColor, CanDisableRipple, FocusableOption {
                        ~~~~~~~~~
node_modules/@angular/material/button/button.d.ts:22:22 - error TS2420: Class 'MatButton' incorrectly implements interface 

'CanDisable'. Property 'disabled' is missing in type 'MatButton' but required in type 'CanDisable'.

Ajeet Shah
  • 18,551
  • 8
  • 57
  • 87
Kushal Bajje
  • 121
  • 1
  • 8
  • looks like a dependencies mismatch. Could you show your package.json – MoxxiManagarm May 11 '21 at 11:04
  • To clarify, the TS1005 error (from the top line of the output you posted) can be caused by using an old TypeScript compiler that doesn't understand newer syntax e.g. spreads (`...`) - maybe you had a more recent compiler in node_modules, and package.json references an older version. Possibly similar to https://stackoverflow.com/questions/46398916/typescript-error-ts1005-expected-ii/47960532 – Gus Hogg-Blake May 11 '21 at 11:11
  • This is my package.json file https://github.com/kushalbajje/cfp/blob/main/package.json – Kushal Bajje May 11 '21 at 11:28

1 Answers1

0

TS1005 is a TypeScript compilation error that's caused by invalid syntax - in this case it looks like the syntax is valid for newer versions of the compiler, but npm install has fetched an old version for some reason.

Gus Hogg-Blake
  • 2,393
  • 2
  • 21
  • 31
  • After ng serve when the server starts listening to port, if I save the app.module.ts I am getting errors under angular material. Could you help me with this, I am new to angular I think version mismatch causing this error but I am not sure. – Kushal Bajje May 11 '21 at 11:18