App, deployed on github pages, sends GET for assets to wrong address

13    7 months ago

I have built my app using:

ng build --prod --base-href

I noticed that deployed app doesn't load some images. 

Properly loaded images are obtained by GET sent to this address: 
and for some reason app tries to load other images using wrong address:, which results in not loading some assets.

I noticed this behaviour after updating my angular project.


Not loaded images are specified with css: background-image: url("/assets/fileName");
Loaded images are specified with html: <img src="assets/fileName"/>

after changing url("/assets/fileName") to url("/zpi-frontend/assets/fileName") images are being loaded but there should be better solution

Answers { 1 }
7 months ago

Try using the --deployUrl when running the ng build command. That will set the assets prefix.