[error] Cannot read property 'config' of undefined


#1

Hi there, I’m trying days(headcache) to config deploy service in my app but I get this error:

Please, any can help me?

Error in :0:0 caused by: Cannot read property ‘config’ of undefined
Stack
TypeError: Cannot read property ‘config’ of undefined
at Deploy (http://localhost:8100/build/main.js:61321:27)
at new Deploy (http://localhost:8100/build/main.js:106859:42)
at CompiledTemplate.proxyViewClass.View_pStart_Host0.createInternal (/AppModule/pStart/host.ngfactory.js:19:22)
at CompiledTemplate.proxyViewClass.AppView.createHostView (http://localhost:8100/build/main.js:103711:21)
at CompiledTemplate.proxyViewClass.DebugAppView.createHostView (http://localhost:8100/build/main.js:103971:52)
at ComponentFactory.create (http://localhost:8100/build/main.js:36204:25)
at NavControllerBase._viewInit (http://localhost:8100/build/main.js:28916:44)
at NavControllerBase._nextTrns (http://localhost:8100/build/main.js:28745:18)
at NavControllerBase._queueTrns (http://localhost:8100/build/main.js:28716:14)
at NavControllerBase.push (http://localhost:8100/build/main.js:28560:2

app.module.ts

import { NgModule, ErrorHandler } from ‘@angular/core’;
import { IonicApp, IonicModule, IonicErrorHandler } from ‘ionic-angular’;
import { CloudSettings, CloudModule, Deploy } from ‘@ionic/cloud-angular’;
import { MyApp } from ‘./app.component’;
import { Page2 } from ‘…/pages/page2/page2’;
import { ApiService } from ‘…/providers/api-service’;

const cloudSettings: CloudSettings = {
‘core’: {
‘app_id’: ‘xxxx’
}
};

@NgModule({
declarations: [
MyApp,
Page2
],
imports: [
IonicModule.forRoot(MyApp),
CloudModule.forRoot(cloudSettings)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
Page2
],
providers: [{provide: ErrorHandler, useClass: IonicErrorHandler}, ApiService, Deploy]
})
export class AppModule {}

app.component.ts

import { Component, ViewChild } from ‘@angular/core’;
import { AlertController } from ‘ionic-angular’;
import { Nav, Platform } from ‘ionic-angular’;
import { StatusBar, Splashscreen } from ‘ionic-native’;
import { Deploy } from ‘@ionic/cloud-angular’;
import { pStart } from ‘…/pages/pStart/pStart’;
import { pCadastroCliente } from ‘…/pages/pCadastroCliente/pCadastroCliente’;
import { pCadastroEstabelecimento } from ‘…/pages/pCadastroEstabelecimento/pCadastroEstabelecimento’;

import { Page2 } from ‘…/pages/page2/page2’;

@Component({
templateUrl: ‘app.html’,
providers:[Deploy]
})
export class MyApp {
@ViewChild(Nav) nav: Nav;

rootPage: any = pStart;

pages: Array<{title: string, component: any}>;

constructor(public platform: Platform, private alertCtrl: AlertController, private deploy: Deploy){
this.initializeApp();

// used for an example of ngFor and navigation
this.pages = [
  { title: 'Page One', component: pStart },
  {title:'Cadastro', component:pCadastroCliente},
  {title:'Cadastro', component:pCadastroEstabelecimento},
  { title: 'Page Two', component: Page2 }
];
this.deploy.channel = 'production';
    this.deploy.check().then((snapshotAvailable: boolean) => {
      if (snapshotAvailable) {
        // When snapshotAvailable is true, you can apply the snapshot
        this.presentConfirm();
      }
    });

}

initializeApp() {
this.platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
StatusBar.styleDefault();
Splashscreen.hide();
});
}

openPage(page) {
// Reset the content nav to have just this page
// we wouldn’t want the back button to show in this scenario
this.nav.setRoot(page.component);
}
//

presentConfirm() {
let alert = this.alertCtrl.create({
title: ‘Atualização’,
message: ‘Atualização disponível! Deseja atualizar agora?’,
buttons: [
{
text: ‘Cancelar’,
role: ‘cancelar’,
handler: () => {
//console.log(‘Cancel clicked’);
}
},
{
text: ‘Sim’,
handler: () => {
//console.log(‘Buy clicked’);

      this.deploy.download().then(() => {
        return this.deploy.extract();
      });
      this.deploy.load();
    }
  }
]

});
alert.present();
}
//
}

Your system information:

ordova CLI: 6.5.0
Ionic Framework Version: 2.0.0-rc.5
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v6.9.4
Xcode version: Not installed


#2

Please guys, I need a help.Thanks