tsayen / dom-to-image

Generates an image from a DOM node using HTML5 canvas
Other
10.23k stars 1.68k forks source link

DOMException: "Index or size is negative or greater than the allowed amount" #296

Closed saravntbe closed 4 years ago

saravntbe commented 5 years ago

Use case: description, code

Getting DOMException: "Index or size is negative or greater than the allowed amount" in firefox

Actual behavior (stack traces, console logs etc)

DOMException: "Index or size is negative or greater than the allowed amount"

Library version

2.6.0

Browsers

similar Issue

vitoo commented 4 years ago

Same error, same version and firefox 68

vitoo commented 4 years ago

My issue was that the DOM node was not visible

So i add a check, with jQuery :

if($('#element').is(':visible')){

 domtoimage.toPng( ... )

}