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.
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
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!!!