Some broken images in build


#1

Hello,

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

Thanks!


#2

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


#3

Can you post the log of error and your code?


#4

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?


#5

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.


#6

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


#7

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


#8

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.