diegomura / react-pdf

📄 Create PDF files using React
https://react-pdf.org
MIT License
14.68k stars 1.17k forks source link

Images not rendering #2085

Open aurasora28 opened 1 year ago

aurasora28 commented 1 year ago

I've been trying to render images, but I've been having some issues. Not all the images are showing, this error is shown.

Access to XMLHttpRequest at 'https://firebasestorage.googleapis.com/v0/b/itm-app-330315.appspot.com/o/quotes%2Fimg%2FLOGOITM.jpeg?alt=media' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. browser-ponyfill.js:518

GET https://firebasestorage.googleapis.com/v0/b/itm-app-330315.appspot.com/o/quotes%2Fimg%2FLOGOITM.jpeg?alt=media net::ERR_FAILED 200

Rezowanur-Rahman-Robin commented 1 year ago

Same problem here with appropriate cors policy.

ghost commented 1 year ago

This is due to the CORS policy of the server.

stonesthatwhisper commented 1 year ago

Probably a dup of #766. Adjust your server CORS configuration so it sends back the Access-Control-Allow-Origin header. It worked for our case. Also check out suggestions in #766, for this suggestion. I didn't end up needing that suggestion, but it may help avoid fetching the image again.