Hello colleagues,
Im trying to build with the the option --prod and I get this error “build prod failed: Unexpected value ‘LoginPage’ declared by the module ‘AppModule’”, but if i run ionic build without the --prod options its work perfect.
My Code
app.module.ts
import { NgModule, ErrorHandler } from '@angular/core';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
import {
LoginPage, HomePage,
AcademyPage, AcademyDetailPage,
ProfilePage, ReservationPage,
ReservationFilterPage,PaymentTabsPage,
ActivityDetailPage
} from '../page';
@NgModule({
declarations: [
MyApp,
LoginPage,
HomePage,
AcademyPage,
AcademyDetailPage,
ProfilePage,
ReservationPage,
ReservationFilterPage,
PaymentTabsPage,
ActivityDetailPage
],
imports: [
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
LoginPage,
HomePage,
AcademyPage,
AcademyDetailPage,
ProfilePage,
ReservationPage,
ReservationFilterPage,
PaymentTabsPage,
ActivityDetailPage
],
providers: [{ provide: ErrorHandler, useClass: IonicErrorHandler }]
})
export class AppModule { }
login.ts
import {Component} from '@angular/core';
import {NavController} from 'ionic-angular';
import {HomePage} from '../../page';
@Component({
selector: 'page-login',
templateUrl: 'login.html'
})
export class LoginPage {
constructor(private navController:NavController) {
}
login(){
this.navController.setRoot(HomePage);
}
}
Your system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.0
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v6.5.0
Xcode version: Xcode 8.1 Build version 8B62
Thanks!!