![](/img/trans.png)
[英]TS2611: 'foo' is defined as a property in class 'A', but is overridden here in 'B' as an accessor
[英]'formDirective' is defined as an accessor in class 'ControlContainer', but is overridden here in 'ConnectArrayDirective' as an instance property
將 angular 9 更新到最新版本后 ("@angular/core": "~11.0.0-next.0",)。 我收到以下錯誤,但是,我已經更新了@angular-redux/form, @angular-redux/router and @angular-redux/store
的最新版本
"@angular-redux/form": "^10.0.0",
"@angular-redux/router": "^10.0.0",
"@angular-redux/store": "^10.0.0",
"@angular/common": "~11.0.0-next.0",
"@angular/compiler": "~11.0.0-next.0",
"@angular/core": "~11.0.0-next.0",
"@angular/forms": "~11.0.0-next.0",
ERROR in node_modules/@angular-redux/form/connect-array/connect-array.directive.d.ts:22:14 - error TS2610: 'formDirective' is defined as an accessor in class 'ControlContainer', but is overridden here in 'ConnectArrayDirective' as an instance property.
22 readonly formDirective: FormGroupDirective;
~~~~~~~~~~~~~
node_modules/@angular-redux/form/connect-array/connect-array.directive.d.ts:23:14 - error TS2610: 'path' is defined as an accessor in class 'ControlContainer', but is overridden here in 'ConnectArrayDirective' as an instance property.
23 readonly path: string[];
這些庫不再維護,檢查這個 repo
作為升級項目時的解決方法,我在compilerOptions內的 tsconfig.json 中設置了“skipLibCheck”:true,如下所示:
{
...,
"compilerOptions": {
...,
...,
"skipLibCheck": true,
...,
...
},
"angularCompilerOptions": {
...
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.