react-to-image icon indicating copy to clipboard operation
react-to-image copied to clipboard

Getting CORS error

Open yusuf-murodov-gamerpay opened this issue 1 year ago • 3 comments

When converting react component containing img tag with external source url, there conversion gets failed with CORS error because fetching image data gets failed. I have no control to the server to allow/enable CORS.

Reproducing steps:

  1. Create a component which contains img tag with external source
  2. Convert component to any image type
image

yusuf-murodov-gamerpay avatar Nov 23 '23 18:11 yusuf-murodov-gamerpay

Hi @yusuf-murodov-gamerpay Could you provide a reproducible example so I can take a look at it?

Thanks

hugocxl avatar Nov 24 '23 05:11 hugocxl

I'm having the same problem here.

Access to fetch at 'https://firebasestorage.googleapis.com/v0/b/testmd-21f8a.appspot.com/o/images%2Fimagini-itemi%2F1706724787841Screenshot%202024-01-31%20at%2020.11.56.png?alt=media&token=b9b99217-3d80-4a85-9bf4-7e1221c9ab8f' from origin 'https://testmd-21f8a.web.app' 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.

Ianec21 avatar Jan 31 '24 23:01 Ianec21

@Ianec21 @yusuf-murodov-gamerpay it seems not to be related to this React implementation but an issue from "html-to-image". Could you give it a look?

hugocxl avatar Feb 08 '24 05:02 hugocxl

Closing due to inactivity

hugocxl avatar May 31 '24 19:05 hugocxl