zeeguu / web

Frontend for the zeeguu web application.
https://www.zeeguu.org
3 stars 5 forks source link

Images don't load in netlify #396

Closed mircealungu closed 1 week ago

mircealungu commented 1 month ago

After PR https://github.com/zeeguu/web/pull/393 images don't load anymore on netlify.

e.g. when trying to preview the changes in https://github.com/zeeguu/web/pull/394 this is how it looks

image

The problem is that with the new image path function, the images are loaded by default from zeeguu.org, but they are not there yet. What we might want to do is to not hardcode the zeeguu.org as default but rather, try to detect automatically the domain on which the app is currently deployed and use that as default.

tfnribeiro commented 1 month ago

I have tried to replace the default with: window.location.hostname, which returns 'deploy-preview-394--voluble-nougat-015dd1.netlify.app', but it seems that netlify still has the server defaults:

image

So this would mean that it's loading the environment variables through NPM, I think that would mean that it's somehow in the deploy scripts for it. I am not sure where I can find those?

tfnribeiro commented 1 month ago

Using window.location.origin seems to work!

However, I had to comment out the process.env.REACT_APP_WEB_URL, so now I am quite sure that the environment variable is set somewhere for netlify.

image

tfnribeiro commented 3 weeks ago

Fixed in: https://github.com/zeeguu/web/pull/394