Some broken images in build



I’d like to find out what’s going on… When I view my app with ionic serve all images load correctly. When I build my app and run it on a device, only some of the images are broken. Half of them work as expected.

This clearly isn’t about file paths - I can’t figure it out!

They are all stored in /assets/img/avatars



I found out while writing this post that longer file names work - why on earth is this?


Can you post the log of error and your code?


It clearly is - otherwise the pictures would load if they exist.
Are you sure the loading and not-loading images are using the same paths?


Well, it’s not a problem with the path string in the img src tag. The file isn’t appearing where it’s meant to be or called what I named it! They are using identical paths. Making the file name longer has fixed it.


Did you by any chance changed the image names from capital to small letters or viceversa in the past?


When I first pasted the images in that folder I renamed them all. They had capitals and spaces in the names.


Then it probably has something to do with that. Images could be cached pretty hard, therefore renaming images can be quite a hassle. I would throw out your www/assets folder out the window and recompile again when you’re renaming images, because of this.