alessiomaffeis / vue-picture-input

Mobile-friendly picture file input component for Vue.js 2-3 with image preview, drag and drop, EXIF orientation, and more
MIT License
888 stars 156 forks source link

Prefill failed to fetch #136

Closed IvanRalph closed 3 years ago

IvanRalph commented 3 years ago

Encountered Prefill: failed to fetch error.

Implementation: image

Error encountered: image

Any fix for this?

alessiomaffeis commented 3 years ago

Hi @IvanRalph! The web server where the prefilled src image is located has a CORS policy that doesn't allow fetching files from the domain your application is located. You should be able to fix it by adding proper Access Control headers to the image server response: https://jeremyliberman.com/2019/02/11/fetch-has-been-blocked-by-cors-policy.html

joaolisboa commented 3 years ago

I have this issue but only with this package. Even bootstrap-vue with the BAvatar component correctly loads the image. I have no control over the server where the image is stored so fixing it on that end is not a solution, but since bootstrap can load the image why doesn't this one work?