dom-to-image
dom-to-image copied to clipboard
Uncaught (in promise)
Yup... I got it too. No particular reason I can think of. Two images are from a foreign server - but that shouldn't break the whole process?
What I called:
domtoimage.toJpeg(document.body, { quality: 0.95 })
.then(function (dataUrl) {
var link = document.createElement('a');
link.download = 'gazelle-screenshot.jpg';
link.href = dataUrl;
link.click();
});
PS: Switched to html2canvas, works like a charm
I had this same issue when I had local images in my page (file:///) and I found this happens because a part in the library's code expects the servers response status code to be 200 on success. So as far as what I can see from the screenshot you shared, the server serving those images are not sending 200 status code instead it sent 0.
Yeah the images are on a different domain and dom-to-image cannot fetch them. Maybe that's what broke the whole thing. I'm using html2canvas now BTW, it's the same as dom-to-image but in, uh, "works".
had the same issue,how did you solve it?