March 15, 2018

Error: Can't resolve all parameters for Storage


Ionic 3 and Angular2 Project. I never noticed this error when using it with Ionic, but it happened now using the @ionic/storage
Error: Can't resolve all parameters for Storage
It it a runtime error and I set up my app.module.ts as follows:
...
import { Storage } from '@ionic/storage';
@NgModule({
  ...
  providers: [
    Storage,
    ...
  ],
  ...
})
export class AppModule{ }

I’ve found a solution using a custom provider like this:
...
import { Storage } from '@ionic/storage';

export function provideStorage() {
 return new Storage();
}

@NgModule({
  providers: [
    ...
        { provide: Storage, useFactory: provideStorage },
    ...
  ],
  ...
})
export class AppModule{ }

And everything works.
Also remember to check out the package version of the @ionic/storage in the package.json file. It should be the latest.
Mine is 2.1.3
"@ionic/storage": "2.1.3",


March 6, 2018

Error: encountered bad status code (503) for https://res.ionic.io/api/v1/transform



If you get this error after building resources for android or iOS then there is an issue contacting the ionic transform API service. HTTP 503 means that there are temporary brief interruption .  NO PANIC. Try again later... ;)

$ ionic cordova resources
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: 7 / 18 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 ...................