Cannot add property “X”, object is not extensible angular 9

南楼画角 提交于 2020-08-08 01:13:34

问题


I have encountered this issue on many places after some days of updating from Angular 8 to Angular 9. Earlier it was working fine.

Can anyone help me what's the problem. Example code below

list.reduce((acc, curr) => {
        const obj = {};
        obj['x'] = curr['Y'];
});

回答1:


I refer change list of Ngrx version 8 to 9 and migration guideline here

https://ngrx.io/guide/migration/v9

As I found there is a special change related to immutability with angular 9. They have defined Action, state and serializability related immutability logic there. And I tried out the method that they have suggested to resolve those issues with Ngrx V9 update here

https://ngrx.io/guide/store/configuration/runtime-checks

@ngrx/store ships with five (5) built-in runtime checks. Try disabled all checks



来源:https://stackoverflow.com/questions/60631071/cannot-add-property-x-object-is-not-extensible-angular-9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!