Hi,
My application build with no problems without --prod --release options but I’m facing an issue when building my application for production using the following command:
ionic cordova buil <platform> --prod --release
Build failed with the following message:
...
[10:34:17] deeplinks started ...
[10:34:19] deeplinks finished in 1.49 s
[10:34:19] ngc started ...
Error: Cannot determine the module for class Button in <...>/node_modules/ionic-angular/es2015/components/button/button.d.ts! Add Button to the NgModule to fix it.
Cannot determine the module for class Icon in <...>/node_modules/ionic-angular/es2015/components/icon/icon.d.ts! Add Icon to the NgModule to fix it.
Cannot determine the module for class Label in <...>/node_modules/ionic-angular/es2015/components/label/label.d.ts! Add Label to the NgModule to fix it.
Cannot determine the module for class OverlayPortal in <...>/node_modules/ionic-angular/es2015/components/app/overlay-portal.d.ts! Add OverlayPortal to the NgModule to fix it.
Cannot determine the module for class IonicApp in <...>/node_modules/ionic-angular/es2015/components/app/app-root.d.ts! Add IonicApp to the NgModule to fix it.
Cannot determine the module for class ClickBlock in <...>/node_modules/ionic-angular/es2015/components/app/click-block.d.ts! Add ClickBlock to the NgModule to fix it.
Cannot determine the module for class Content in <...>/node_modules/ionic-angular/es2015/components/content/content.d.ts! Add Content to the NgModule to fix it.
Cannot determine the module for class ItemReorder in <...>/node_modules/ionic-angular/es2015/components/item/item-reorder.d.ts! Add ItemReorder to the NgModule to fix it.
Cannot determine the module for class Item in <...>/node_modules/ionic-angular/es2015/components/item/item.d.ts! Add Item to the NgModule to fix it.
at syntaxError (<...>/node_modules/@angular/compiler/bundles/compiler.umd.js:1729:34)
at analyzeAndValidateNgModules (<...>/node_modules/@angular/compiler/bundles/compiler.umd.js:24301:15)
at AotCompiler.analyzeModulesAsync (<...>/node_modules/@angular/compiler/bundles/compiler.umd.js:23932:46)
at CodeGenerator.codegen (<...>/node_modules/@angular/compiler-cli/src/codegen.js:32:14)
at Function.NgTools_InternalApi_NG_2.codeGen (<...>/node_modules/@angular/compiler-cli/src/ngtools_api.js:73:30)
at Object.doCodegen (<...>/node_modules/@ionic/app-scripts/dist/aot/codegen.js:6:51)
at <...>/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:42:30
at <anonymous>
ionic info command give the following output:
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.15.2
ionic (Ionic CLI) : 3.15.2
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.0.0
Cordova Platforms : android 6.3.0
Ionic Framework : ionic-angular 3.7.1
System:
ios-deploy : 1.9.0
Node : v8.6.0
npm : 5.3.0
OS : macOS Sierra
Xcode : Xcode 9.0.1 Build version 9A1004
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
Here’s my app.module.ts
//...
// Components
import { ComponentsModule } from '../components/components.module';
// App component
import { MyApp } from './app.component';
//...
@NgModule({
declarations: [
MyApp,
...
],
imports: [
ComponentsModule,
BrowserModule,
HttpModule,
IonicStorageModule.forRoot(),
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
...
],
providers: [
{provide: ErrorHandler, useClass: IonicErrorHandler},
OpenNativeSettings,
CallNumber,
Camera,
File,
Geolocation,
...
]
})
export class AppModule {}
Do you know how to solve this issue ?