The problem of Cannot assign to read only property 'data' of object '#<ImageData>' occurs when using heatmap.js.

Cannot assign to read only property 'data' of object ImageData Problem Solving
Go to your node_modules/heatmap.js/build/heatmap.js file and find line 527.
you will find
You will find exactly img.data = imgDatawhat went wrong.
The reason for the error is probably
"data property seems to be read only on certain browser versions. To fix it, we need to delete this line because and points to the same reference. Any modifications you do to is already reflected to" " data property
seems to It is read-only on some browser versions. To fix it we need to remove this line as and points to the same reference. Any modifications you make will be reflected in. I will raise a PR soon "

So it’s ok if we uncheck this line.

The answer refers to github: https://github.com/pa7/heatmap.js/issues/219

After changing the file, don’t forget to save it and then try it again.npm build

Guess you like

Origin blog.csdn.net/qq_43952288/article/details/132067176