linagora / esn-frontend-common-libs

Common ground for OpenPaaS frontend (https://open-paas.org)
Other
4 stars 12 forks source link

/images/white-logo.svg 404 not found in production mode #104

Closed piavgh closed 3 years ago

piavgh commented 4 years ago

Screenshot 2020-08-26 11:04:42

You can try to replicate this issue by running npm run build:prod and serve the dist folder using a custom webserver (maybe Nginx or https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb)

Don't use npm run serve:prod because it will use webpack-dev-server. The webpack server has a proxy to our backend so that it can get the .svg)

It causes the UI to be broken. This image needs to be fetched from backend because if a user changes theme, it will also be updated

rezk2ll commented 4 years ago

hello @piavgh I can't seem to reproduce this, can you please provide what SPA you tested with?

piavgh commented 4 years ago

Hi @rezk2ll ,

As Michael confirmed that our SPAs will be deployed on the same domain with the backend API. I think it will not be a problem for us anymore.

The reason behind it is: in some .pug files or .css files, we link to this /images/white-logo.svg using src="/images/white-logo.svg" or url(...), so if the SPA and backend API are on different domains, this request will be 404 not found.

But now they are on the same domain (e.x localhost:8080 or abc.com), when it requests to 'images/white-logo.svg', the backend API can still return the data.

I will close this issue

tanandy commented 3 years ago

we need this to split the domain, backend and frontend wont be on the same domain

tanandy commented 3 years ago

https://github.com/OpenPaaS-Suite/esn-frontend-common-libs/search?p=1&q=%2Fimages

tanandy commented 3 years ago

we need first to migrate static ressources on each SPA

fabienmoyon commented 3 years ago

We now want to deployed SPAs on different domains that the the backend API

context

https://github.com/OpenPaaS-Suite/esn-frontend-common-libs/issues/104#issuecomment-681985163

TO DO

All assets must be use the SPA name output.

Need to done on each SPA :

fabienmoyon commented 3 years ago

After investigation, we need also to add the tiny logo and the throbber-amber.svg like it was done for the white-logo here : https://github.com/rezk2ll/esn-frontend-contacts/blob/92ac91cf7615ad692a13b581ad802b70f56a6562/webpack.commons.js#L82 and here for the throbber-amber.svg here : https://github.com/linagora/esn-frontend-calendar-public/pull/32/files?file-filters%5B%5D=.js