Description:
If you have the resources for your platform already and you reinstall your platform (for some reason), the ionic-cli will force a resources command, deleting the existing resources in the process. This is a problem because, if the Ionic servers aren't working as expected (like right now), the resources won't be generated and you can't build your app because it doesn't have the resources it needs.
I can't do anything right now until the Ionic servers go back to normal.
Steps to Reproduce:
Example repo:
Output:
Saving ios@~4.5.4 into config.xml file ...
> ionic cordova resources ios --force
✔ Collecting resource configuration and source images - done!
✔ Filtering out image resources that do not need regeneration - done!
✔ Uploading source images to prepare for transformations - done!
✖ Generating platform resources: 8 / 32 complete - failed!
Error: encountered bad status code (503) for https://res.ionic.io/api/v1/transform
body: <!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<title>Application Error</title>
<style media="screen">
html,body,iframe {
margin: 0;
padding: 0;
}
html,body {
height: 100%;
overflow: hidden;
}
iframe {
width: 100%;
height: 100%;
border: 0;
}
</style>
</head>
<body>
<iframe src="//www.herokucdn.com/error-pages/application-error.html"></iframe>
</body>
</html>
at Response.res.on (/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-utils/lib/cordova/resources.js:150:32)
at emitNone (events.js:105:13)
at Response.emit (events.js:207:7)
at emitNone (events.js:110:20)
at IncomingMessage.emit (events.js:207:7)
at endReadableNT (_stream_readable.js:1059:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
My ionic info:
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-plugin-proxy : 1.5.7
@ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.1.7
Cordova Platforms : ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
ios-deploy : 1.9.2
ios-sim : 5.1.0
Node : v8.4.0
npm : 5.7.1
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b
Other Information:
@miniskulljob You can use the --no-resources option when adding platforms to skip that part.
I'm a bit confused. When does ionic cordova resources delete existing resources? Do you mean it _overwrites_ them? It shouldn't outright delete them.
As for the unreliability of the resource server--apologies. I have not yet found time to improve that.
@dwieeb I should have taken a look at the add platform command in the docs, my bad then.
When the command failed, the files that were not converted had in its contents the HTML error I posted before, they no longer were image files.
@miniskulljob Thanks for clarifying! That's really bad behavior. I'll take a look.
@miniskulljob I was able to reproduce this issue right away. I hope you don't mind if I hijack your issue and change the title.
@dwieeb thank you very much, and I'm sorry I didn't explain that before.