Images in folder inside assets don't show up on ionic View app

Inside my /assets/ folder I have a folder called “Client” which I hot swap using GIT to change client themes. When i use the simulator, the ionic serve, chrome, safari, or the emulator, i get the images. My path in my CSS is like

background: url("/assets/client/background.png");

that works fine in emulator, simulator, serve.

but when I do IONIC upload, those images don’t show up???

any thoughts? any reason why that wouldn’t work or do you think its just a upload to the ionic server issue? etc. any help would be appreciated. need the ionic View app to show my client my progress and showing him a app with no background image is unnacceptable.

thanks!

  1. client is not Client
  2. Can you just build the app yourself?

remove first slash from path

assets/client/background.png
1 Like

Hey guys, thanks for your replies.

the first issue is that if my paths are wrong, then why does it work in Google Chrome? Safari? Both IOS and Android Emulators?

so its not a path issue. i did change the path with no slash like you suggested, no change. I also did have them all lowercase names and paths, (sorry i wrote Titlecase on clients).

either way, both suggestions lead nowhere. its weird because i have a logo in the same folder that does work. not sure if ionic just chokes uploading or what. I tried to swap over to use the new pro ionic view but that was a PITA setting up and i had to rollback everything. so im stuck with legacy ionic view which seems to have its own issues

Maybe a dumb question, but is your app linked with ionic legacy (apps.ionic.io) or ionic pro? (https://dashboard.ionicjs.com/). I read and experience quite of lot issues with the new ionic pro cloud platform.

If all goes south with new ionic pro, you can go back to ionic legacy (until Jan18).

ionic config set -g backend legacy

and switch with both of them

ionic config -set backend pro

And redo the link with ionic link if needed.

I THINK it’s because when running on Ionic Serve, etc., the folder is relative to localhost, whereas running on an actual device, localhost is no longer in the picture. At that point, your assets folder needs to be accessed relative to index.html.

… and working in emulator but not in Ionic View because the environments are also different.

But if you tested the path and the same setup work for another file, look at the file names again. Anything else special about them?

Oh, is the other file also background?

i switched to Ionic Pro with ionic view and they work great now! i dont know why they dont work on legacy? maybe cached or just wacky… it was weird.

considered it resolved by upgrade

1 Like