mat-contenteditable stopped working after upgrading angular, angular mat to version 13

Viewed 170

mat-contenteditable cuases errors after upgrading anguarl version from 12 to 13

Error: /node_modules/mat-contenteditable/lib/mat-ckeditor.directive.d.ts:9:22 - error TS2420: Class 'MatCkeditorDirective' incorrectly implements interface 'CanUpdateErrorState'.
  Property 'updateErrorState' is missing in type 'MatCkeditorDirective' but required in type 'CanUpdateErrorState'.

9 export declare class MatCkeditorDirective extends _MatInputMixinBase implements MatFormFieldControl<string>, DoCheck, CanUpdateErrorState, OnInit {
                       ~~~~~~~~~~~~~~~~~~~~

  /node_modules/@angular/material/core/common-behaviors/error-state.d.ts:17:5
    17     updateErrorState(): void;
           ~~~~~~~~~~~~~~~~~~~~~~~~~
    'updateErrorState' is declared here.


Error: /node_modules/mat-contenteditable/lib/mat-contenteditable.directive.d.ts:4:29 - error TS2305: Module '"@angular/material/core"' has no exported member 'CanUpdateErrorStateCtor'.

4 import { ErrorStateMatcher, CanUpdateErrorStateCtor, CanUpdateErrorState } from '@angular/material/core';
                              ~~~~~~~~~~~~~~~~~~~~~~~


Error:/node_modules/mat-contenteditable/lib/mat-contenteditable.directive.d.ts:19:22 - error TS2420: Class 'MatContenteditableDirective' incorrectly implements interface 'CanUpdateErrorState'.
  Property 'updateErrorState' is missing in type 'MatContenteditableDirective' but required in type 'CanUpdateErrorState'.

19 export declare class MatContenteditableDirective extends _MatInputMixinBase implements ControlValueAccessor, MatFormFieldControl<string>, DoCheck, CanUpdateErrorState {
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~

  /node_modules/@angular/material/core/common-behaviors/error-state.d.ts:17:5
    17     updateErrorState(): void;
           ~~~~~~~~~~~~~~~~~~~~~~~~~
    'updateErrorState' is declared here.




× Failed to compile.

package.json:

"@angular/material": "^13.3.2", "@ckeditor/ckeditor5-angular": "^2.0.2", "@ckeditor/ckeditor5-build-decoupled-document": "^31.1.0", "mat-contenteditable": "^9.1.0",

1 Answers

Don't know if it's a good way to solve the issue, i don't like to touch code that i don't own..., but i manage to build again doing this two updates :


In file node_modules\mat-contenteditable\mat-contenteditable.directive.d.ts :

- remove --> import { CanUpdateErrorStateCtor } from '@angular/material/core';
+ add --> import { _Constructor, _AbstractConstructor } from '@angular/material/core';
+ add (just after the imports) --> declare type CanUpdateErrorStateCtor = _Constructor<CanUpdateErrorState> & _AbstractConstructor<CanUpdateErrorState>;
+ add (in the directive) --> updateErrorState(): void;

In file node_modules\mat-contenteditable\mat-ckeditor.directive.d.ts :

+ add (in the directive) --> updateErrorState(): void;
Related