# Error while running the ionic3 app in production mode

**URL:** <https://forum.ionicframework.com/t/error-while-running-the-ionic3-app-in-production-mode/106294>\
**Category:** ionic-v3\
**Created:** [September 21, 2017, 3:59pm UTC](https://forum.ionicframework.com/t/error-while-running-the-ionic3-app-in-production-mode/106294 "2017-09-21T15:59:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![santoshvarma33](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@santoshvarma33](https://forum.ionicframework.com/u/santoshvarma33)\
**Post date:** [September 21, 2017, 3:59pm UTC](https://forum.ionicframework.com/t/error-while-running-the-ionic3-app-in-production-mode/106294/1 "2017-09-21T15:59:22Z")

</div>

I am facing an issue when I try to build my app using the following command -

ionic cordova run android --prod --release

Everything runs fine if I run the command as below -

ionic cordova run android

The error Iam getting is -

> Error: Cannot determine the module for class CartItemsPage in C:/test/src/pages/cart/cart-items.ts! Add CartItemsPage to the NgModule to fix it. Cannot determine the module for class ItemsPage in C:/test/src/pages/items/items.ts! Add ItemsPage to th e NgModule to fix it. Cannot determine the module for class UserHomePage in C:/test/src/pages/user-home/user-home.ts! Add User HomePage to the NgModule to fix it. Cannot determine the module for class ForgotPasswordPage in C:/test/src/pages/forgot-password/forgot-pas sword.ts! Add ForgotPasswordPage to the NgModule to fix it. Cannot determine the module for class LoginPage in C:/test/src/pages/login/login.ts! Add LoginPage to th e NgModule to fix it. Cannot determine the module for class SignupPage in C:/test/src/pages/signup/signup.ts! Add SignupPage t o the NgModule to fix it. Cannot determine the module for class WelcomePage in C:/test/src/pages/welcome/welcome.ts! Add WelcomePa ge to the NgModule to fix it. Cannot determine the module for class PincodePage in C:/test/src/pages/pincode/pincode.ts! Add PincodePa ge to the NgModule to fix it. Cannot determine the module for class AppHomePage in C:/test/src/pages/app-home/app-home.ts! Add AppHome Page to the NgModule to fix it. Cannot determine the module for class ProfilePage in C:/test/src/pages/profile/profile.ts! Add ProfilePa ge to the NgModule to fix it. Cannot determine the module for class OrderDetailPage in C:/test/src/pages/myorders/order-detail.ts! Add OrderDetailPage to the NgModule to fix it. Cannot determine the module for class MyOrdersPage in C:/test/src/pages/myorders/myorders.ts! Add MyOrde rsPage to the NgModule to fix it. Cannot determine the module for class LogoutPage in C:/test/src/pages/logout/logout.ts! Add LogoutPage t o the NgModule to fix it. Cannot determine the module for class MyApp in C:/test/src/app/app.component.ts! Add MyApp to the NgModu le to fix it. Cannot determine the module for class RemoveUnderscorePipe in C:/test/src/utils/pipes/RemoveUnderscore.t s! Add RemoveUnderscorePipe to the NgModule to fix it.

but I have added all my pages and pipes to app.module.ts as below -

> // Imports
> 
> // The translate loader needs to know where to load i18n files  
> // in Ionic’s static asset pipeline.  
> export function HttpLoaderFactory(http: Http) {  
> return new TranslateHttpLoader(http, ‘./assets/i18n/’, ‘.json’);  
> }
> 
> let pages:any = [  
> MyApp,  
> LoginPage,  
> UserHomePage,  
> SignupPage,  
> AppHomePage,  
> WelcomePage,  
> ItemsPage,  
> CartItemsPage,  
> ProfilePage,  
> MyOrdersPage,  
> OrderDetailPage,  
> ForgotPasswordPage,  
> PincodePage,  
> LogoutPage  
> ];
> 
> let pipes = [RemoveUnderscorePipe];
> 
> export function declarations() {  
> return pages.concat(pipes);  
> }
> 
> export function entryComponents() {  
> return pages;  
> }
> 
> export function providers() {  
> return [  
> Api,  
> ItemsService,  
> UserService,  
> ToastService,  
> CartService,  
> OrdersService,  
> TokenService,  
> Camera,  
> GoogleMaps,  
> SplashScreen,  
> StatusBar,
> 
> ```
> // Keep this to enable Ionic's runtime error handling during development
> {provide: ErrorHandler, useClass: IonicErrorHandler}
> 
> ```
> 
> ];  
> }
> 
> @NgModule({  
> declarations: declarations(),  
> imports: [  
> BrowserModule,  
> HttpModule,  
> TranslateModule.forRoot({  
> loader: {  
> provide: TranslateLoader,  
> useFactory: HttpLoaderFactory,  
> deps: [Http]  
> }  
> }),  
> IonicModule.forRoot(MyApp),  
> IonicStorageModule.forRoot()  
> ],  
> bootstrap: [IonicApp],  
> entryComponents: entryComponents(),  
> providers: providers()  
> })  
> export class AppModule {  
> }

My app is ready but due to this issue iam not able to post it to production. How can i resolve this issue. Please Help

Thanks

---

<div class="post-metadata">

**Author:** ![drquochoai](https://avatars.discourse-cdn.com/v4/letter/d/958977/32.png) [@drquochoai](https://forum.ionicframework.com/u/drquochoai)\
**Post date:** [September 21, 2017, 4:04pm UTC](https://forum.ionicframework.com/t/error-while-running-the-ionic3-app-in-production-mode/106294/2 "2017-09-21T16:04:31Z")

</div>

> [@santoshvarma33](#):
>
> @NgModule({
> 
> declarations: **declarations()**,
> 
> imports: [
> 
> BrowserModule,

Try change to

```auto
declarations: pages

```

full code is

```auto
export function HttpLoaderFactory(http: Http) {
    return new TranslateHttpLoader(http, '. / assets / i18n /', '.json');
}

let pages: any = [
    MyApp,
    LoginPage,
    UserHomePage,
    SignupPage,
    AppHomePage,
    WelcomePage,
    ItemsPage,
    CartItemsPage,
    ProfilePage,
    MyOrdersPage,
    OrderDetailPage,
    ForgotPasswordPage,
    PincodePage,
    LogoutPage
];

let pipes = [RemoveUnderscorePipe];

let providers = [
    Api,
    ItemsService,
    UserService,
    ToastService,
    CartService,
    OrdersService,
    TokenService,
    Camera,
    GoogleMaps,
    SplashScreen,
    StatusBar,

    // Keep this to enable Ionic's runtime error handling during development
    {
        provide: ErrorHandler,
        useClass: IonicErrorHandler
    }
]

@NgModule({
    declarations: pages,
    imports: [
        BrowserModule,
        HttpModule,
        TranslateModule.forRoot({
            loader: {
                provide: TranslateLoader,
                useFactory: HttpLoaderFactory,
                deps: [Http]
            }
        }),
        IonicModule.forRoot(MyApp),
        IonicStorageModule.forRoot()
    ],
    bootstrap: [IonicApp],
    entryComponents: pages,
    providers: providers
})
export class AppModule {}

```

---

<div class="post-metadata">

**Author:** ![santoshvarma33](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@santoshvarma33](https://forum.ionicframework.com/u/santoshvarma33)\
**Post date:** [September 21, 2017, 4:38pm UTC](https://forum.ionicframework.com/t/error-while-running-the-ionic3-app-in-production-mode/106294/3 "2017-09-21T16:38:24Z")

</div>

> [@santoshvarma33](#):
>
> ionic cordova run android --prod --release

Thanks alot it worked! 🙂
