File paths wrong after installing on iOS

This most likely isn’t an issue with ionic but I figured someone here might know the answer. After installing my app on iOS the paths to my javascript files aren’t resolving. My CSS file paths are correct and resolve just fine. Ive tried making a new project and just copying my www/ directory over to it and rebuilding and I still have the same issue.

This is what the path to my js files looks like in Safari Dev Tools:

Full URL: file:///lib/ionic/release/js/ionic.bundle.js

and this is what the path looks like to my css:

Full URL: file:///private/var/mobile/Containers/Bundle/Application/C258DEB4-97A4-4BD0-A08F-1E72BCA4562B/HelloCordova.app/www/css/ionic.app.css

Hmm, interesting issue.

What do you file paths look like in your index.html?

Both the CSS and JS have relative paths. Its really strange.

<link href="css/ionic.app.css" rel="stylesheet">
<script src="lib/ionic/release/js/ionic.bundle.js"></script>

Never mind, I figured it out. Somehow at some point <base href="/"> got added to my index.html below the css but above the js. Removing that fixed my issues and explains why the css paths were correct and the js wasn’t.

1 Like

Oh man, that can mess things up. Glad to hear you found the issue and were abel to resolve it :smile: