I was seeing this error on Chrome
while I was testing my code locally. I switched to Firefox
and I am not seeing the error any more. Maybe switching to another browser is a quick fix.
If you are using the solution given in first answer, then make sure you add img.crossOrigin = "Anonymous";
just after you declare the img
variable (for eg. var img = new Image();
).