Skip to content

Do not overwrite image files with resource server error #3005

@miniskulljob

Description

@miniskulljob

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:

  1. ionic cordova platform rm ios
  2. ionic cordova platform add ios

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions