-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught (in promise) error { target: img, isTrusted: true, srcElement: img, … } #467
Comments
Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. |
The same issues. |
Hello, is there anything new on this issue? |
Any news? |
Hello, is there anything new on this issue? |
hi, for the moment, I've switched to html2canvas. |
I have the same issue. Looks like this happens when it's trying to download external images. It works fine with local images. Quick solution:
|
I think it's due to the size of the image generated, because the image attached to the error is 32mo on my side, whereas it's specified in the doc that there may be problems if the DOM is huge. |
Any updates on this? |
Found solution that works fine on my end, but it's pain to compress any assets inside the canvas one by one, anyone could improve this solution anyway https://gist.github.com/fzn0x/d41864e95c7412087b859139ef49aa1b Thanks @leCheveuCodeur basically you need to keep your canvas size as small as possible |
Thanks @fzn0x What fixed the issue for me was that, when dealing with images hosted in s3, you should invalidate the cache for the requested image, like so: toPng(ref.current, {
fetchRequestInit: {
method: 'GET',
cache: 'no-cache' // <-- Important!
}
}) For anybody else dealing with this problem, try this before attempting something more sophisticated. |
Any updates on this? |
@leCheveuCodeur |
Expected Behavior
download png image of provided element (body)
Current Behavior
I get this error but can't get more details from the developer console :
Steps To Reproduce
here is what is done :
html-to-image.js
(1.11.11) is retrieved from https://cdnjs.com/libraries/html-to-imagetrue
without any error)Your Environment
The text was updated successfully, but these errors were encountered: