Ionic 3 error after update

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

help me !!! plsā€¦

Please show BusinessContactsUpdate.ts and BusinessContactsUpdate.html full

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

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

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

help,help this error made me crazyā€¦

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

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ā€¦

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

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.

1 Like

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

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>

Check this link, if this can help you:

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.

problem aways in!!!
but when i user ionic2 ,main.js is too big but canā€™t compress ,so i update to ionic3ā€¦

sorry ,sorry ,please help me,thx

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

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