I recently update my project from Typescript 3.5 to 3.8. Everything run smoothly expect some operation on array.
const usedROI = this.rois.find((roi) => roi.id === roiId);
usedROI.position.height = position.height;
ERROR TypeError: Cannot assign to read only property 'height' of object '[object Object]'
let rerouteWaypoint = route.waypoints.filter((wp) => wp.type === IWaypointType.REROUTE_POINT);
rerouteWaypoint.forEach((wp) => (wp.type = IWaypointType.USER_POINT));
ERROR TypeError: Cannot assign to read only property 'type' of object '[object Array]'
const wps = state.entities[action.payload.routeId].waypoints;
const wp = {
...wps[index],
...action.payload.changes,
};
wps[index] = { ...wp }; <= this line breaks
core.js:4117 ERROR TypeError: Cannot assign to read only property '0' of object '[object Array]'
I do not use readonly anywhere in my app, it looks like all my array are frozen and uneditable.
Why so ? I do not see it in the breaking changes. Is there a way to find in visual code ALL the spot where this problem occur ? cause right now only the error pop at runtime and it's really unsafe to deploy such a version.
EDIT : Someone talk about a similar problem here => Error while sorting array of objects Cannot assign to read only property '2' of object '[object Array]'
but I do not see why simple array are also throwing it without beeing redux stored elements.