I am getting an error that says, "Cannot add property count; the object is not extensible" while running LWC [duplicate]. Why is that?
While running the given Javascript, an error is coming on the count and show records as I am adding an array into it. How do we resolve the error?
It seems that the response from Apex cannot be extended with additional parameters with Spring 20. Which means that the object is not extensible https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/preventExtensions For objects, you can use either result = object.assign({}, result)or item = object.assign({}, item)as a workaround for every item in result for arrays in a loop. You can also spread syntax data = { ...result };. There is another dirty hack, JSON.parse(JSON.stringify(result));.