Ionic 3 error after update


#1

system info is:
global packages:

@ionic/cli-utils : 1.0.0
Cordova CLI      : 6.5.0
Ionic CLI        : 3.0.0

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.0.0
@ionic/cli-plugin-ionic-angular : 1.0.0
Ionic Framework                 : ionic-angular 3.2.0

System:

Node       : v6.10.3
OS         : Windows 10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed

command: ionic cordova build android --prod

Error: ./src/pages/contact/BusinessContactsUpdate.ts
Module build failed: TypeError: Cannot read property ‘content’ of undefined
at Object.optimizationLoader (F:\ionic2\iCarApp201705081419_RC2\node_modules_@ionic_app-scripts@1.3.7@@ionic\app-scripts\dist\webpack\optimization-loader-impl.js:14:24)
at Object.loader (F:\ionic2\iCarApp201705081419_RC2\node_modules_@ionic_app-scripts@1.3.7@@ionic\app-scripts\dist\webpack\optimization-loader.js:5:32)
@ ./src/app/app.module.js 61:0-85
@ ./src/app/app.module.ngfactory.js
@ ./src/app/main.ts


#2

help me !!! pls…


#3

Please show BusinessContactsUpdate.ts and BusinessContactsUpdate.html full


#4


#5

hi when i use :
ionic cordova build android,success
but ionic cordova build android --prod ,always show error like up…


#6

have you try to run the app using ionic serve first?
did you get the same error?


#7

yes,i have try ionic serve,work for me success!!! but have a error like follow


#8

help,help this error made me crazy…


#9

error message you get is for cordova.
if you upgrade your ionic native to v.3.x.x you will never get that error…
if you still using ionic native v.2.x.x it’s normal for you to get that error message…

for your case now, try to run ionic run android command… and deploy your app to compatible device,
if you still get build problem i guess it’s something to do with the plugin you are using now


#10

oh~~ please see above,ionic native is v3,and when i use

ionic cordova build android everything is ok

ionic cordova build android --prod error’s like the pic up up up…


#11

anyone can help me? realy realy need help,thx!!!


#12

You should really post your code as text and not as screenshots. Right now nobody can use Ctrl+F on your code, nobody can google your error message. If you want help, post your code and the error message and format it correctly so we can read it.


#13

i’m sorry @sky_zt hehehe… i forgot the root cause…
me and my boss actually get the same error like this 2 weeks ago…
i suggest you to read this https://github.com/driftyco/ionic-native/releases
on v.3.7.0 they say build error is fixed… i wish it will help your problem


#14

sorry

ionic cordova build android --prod

Error: ./src/pages/contact/BusinessContactsUpdate.ts
Module build failed: TypeError: Cannot read property ‘content’ of undefined
at Object.optimizationLoader (F:\ionic2\iCarApp201705081419_RC2\node_modules_@ionic_app-scripts@1.3.7@@ionic\app-scripts\dist\webpack\optimization-loader-impl.js:14:24)
at Object.loader (F:\ionic2\iCarApp201705081419_RC2\node_modules_@ionic_app-scripts@1.3.7@@ionic\app-scripts\dist\webpack\optimization-loader.js:5:32)
@ ./src/app/app.module.js 61:0-85
@ ./src/app/app.module.ngfactory.js
@ ./src/app/main.ts

system info

global packages:
    @ionic/cli-utils : 1.0.0
    Cordova CLI      : 6.5.0
    Ionic CLI        : 3.0.0
local packages:
    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.0.0
    @ionic/cli-plugin-ionic-angular : 1.0.0
    Ionic Framework                 : ionic-angular 3.2.0
System:
    Node       : v6.10.3
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

BusinessContactsUpdate.ts


import { Component } from '@angular/core';

import { NavController,NavParams,ViewController } from 'ionic-angular';

@Component({
  selector: 'page-contact',
  templateUrl: 'businessContactsUpdate.html'
})

export class BusinessContactsUpdatePage {
  linkMan:string;
  clickNum:number=0;
  constructor(public navCtrl: NavController,private navParams:NavParams,private viewCtrl:ViewController) {
    this.linkMan = navParams.get('linkMan');
  }

  saveLinkMan(){
    let data = { linkMan:this.linkMan };
    this.viewCtrl.dismiss(data);
    //this.navCtrl.pop(this.linkMan);
  }
    goback(){
        if(this.clickNum==0){
            this.clickNum=1;
            this.navCtrl.pop();
        }
        
    }
}

BusinessContactsUpdate.html

< ion-header no-shadow>
    < ion-navbar hideBackButton="true">
        < button ion-button menuToggle (click)="goback()">
            < ion-icon ios="ios-arrow-back" md="md-arrow-back"></ion-icon>
        < /button>
        < ion-title>modify</ion-title>
        < ion-buttons right id="mg-mainRange-update" tappable (click)="saveLinkMan()">
            < button ion-button icon-only menuToggle>
        < ion-icon name="save">save</ion-icon>
      < /button>
        < /ion-buttons>
    < /ion-navbar>
< /ion-header>

< ion-content id="mg-store-correlation">
    < ion-list no-border-bottom class="mg-info-list">
        < ion-item>
            < ion-input type="text" placeholder="contact" [(ngModel)]="linkMan">{{linkMan}}</ion-input>
        < /ion-item>
    < /ion-list>
< /ion-content>

#15

Check this link, if this can help you:


#16

Please edit your post and use the </> button above the post input field to format your code or error message or wrap it in ``` (“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.


#17

problem aways in!!!
but when i user ionic2 ,main.js is too big but can’t compress ,so i update to ionic3…


#18

sorry ,sorry ,please help me,thx


#19

Your code looks worse than before. I won’t invest the time trying to read that. Hope somebody else will. good luck.


#20

so sorry !!! i have format my code now ,please help me,thx!!!