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
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
sky_zt
May 12, 2017, 10:06am
8
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
sky_zt
May 12, 2017, 10:33am
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…
sky_zt
May 12, 2017, 11:03am
11
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.
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
sky_zt
May 12, 2017, 11:24am
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>
Check this link, if this can help you:
I’m currently trying to set up a basic ionic 2 project. I’ve had everything working fine in v1, but after moving to v2 and fixing some VCBuild-related issues by installing a Windows SDK, ionic serve fails after creating a new project via ionic start MyApp blank --v2.
I get normal output from the script:
[20:53:13] ionic-app-scripts 0.0.43
[20:53:13] watch started ...
[20:53:13] build dev started ...
[20:53:13] clean started ...
[20:53:13] clean finished in 16 ms
[20:53:13] copy started .…
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.
sky_zt
May 12, 2017, 12:08pm
17
problem aways in!!!
but when i user ionic2 ,main.js is too big but can’t compress ,so i update to ionic3…
sky_zt
May 12, 2017, 12:26pm
18
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.
sky_zt
May 12, 2017, 2:21pm
20
so sorry !!! i have format my code now ,please help me,thx!!!