I am trying to use the library html-to-image, I am using it to convert my HTML into a downloadable PNG file.
However I get a CORS error when I try to download my image
HTML element, which is using a src attribute with a link. The error is shown below
Access to fetch at 'https://amazon.s3.com/23424324.jpg' from origin 'https://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
I tried to put the attribute crossorigin="anonymous"
on my Image but this didn't fix the error, and actually made the image not show on my local environment. Just was hoping someone possibly had the same issue when trying to download images using a client side HTML to image download library, let me know any other alternatives if this can't be fixed.
Thank you!