tsayen / dom-to-image

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

use example demo throw the error #373

Open asiainfoliwei opened 3 years ago

asiainfoliwei commented 3 years ago

Use case: description, code

Error when i use lib to generator image use this code

domtoimage.toPng(document.body, { width: window.innerWidth, height: window.innerHeight, cacheBust: true }) .then(function (dataUrl) { var img = new Image(); img.src = dataUrl; document.body.appendChild(img); console.log('ok!'); }) .catch(function (error) { console.error('oops, something went wrong!', error); });

image

Browsers

Chrome 49+

thatONEjustin commented 3 years ago

just got this error as well

Screen Shot 2021-05-14 at 12 46 00 PM
maxzycon commented 3 years ago
Screen Shot 2021-05-31 at 01 06 39

you can use promise all that work on my nuxtjs project

Qarun-Qadir-Bissoondial commented 2 years ago

Can confirm that this is still an issue. The error message isn't informative at all.