将anguarl版本从12升级到13后,mat-contentetable导致错误
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 /材料”:“^13.3.2”,“@检查编辑器/检查编辑器5-Angular ”:“^2.0.2”,“@检查编辑器/检查编辑器5-构建-分离-文档”:“^31.1.0”,“可包含蒙版”:“^9.1.0”,
2条答案
按热度按时间qf9go6mv1#
不知道这是否是解决问题的好方法,我不喜欢接触我不拥有的代码......,但我设法再次构建做这两个更新:
在文件***node_modules\mat-contenteditable\mat-contenteditable.指令.d.ts***中:
在文件***节点模块\mat-contenteditable\mat-ckeditor.指令.d.ts***中:
m2xkgtsf2#
更改/node_modules中的文件并不是最好的方法。
该类CanUpdateErrorStateCtorhas been removed in Material for Angular 13,因此唯一的“安全”选项是处理它并更新导致该错误的依赖项。
我在同一个类上遇到了一个问题,但由另一个库(@angular-material-components/file-input)引起:
这是在版本
6.0.0
,相反,它需要至少版本7.0.0
。更新该版本解决了问题。