Skip to content

Cannot assign to read only property 'data' of object #219

Open
doxo/heatmap.js
#1
@SVPA-CharlieSantos

Description

@SVPA-CharlieSantos

When using heatmap.js on certain browsers, this error Cannot assign to read only property 'data' of object shows up.
screen shot 2016-09-01 at 11 18 47 am

I'm able to reproduce on chromium that is packaged with electron version 1.3.3.

This seems to happen because the data property of ImageData object is being replaced directly in this part of the code. https://github.com/pa7/heatmap.js/blob/master/src/renderer/canvas2d.js#L280

data property seems to be read only on certain browser versions. To fix it, we need to delete this line because imgData and img.data points to the same reference. Any modifications you do to imgData is already reflected to img.data. I'll put up a PR soon.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions