Lazy loading 3rd party component in loaded page


#1

The app working when i run ionic cordova run android --device but gives error when i try ionic cordova run android --prod --release

I am trying use ng2-qrcode into my lazy loaded page

Error: Unexpected value ‘QRCodeComponent in D:/qrstore/node_modules/ng2-qrcode/dist/ng2-qrcode.d.ts’ declared by the module ‘ItemDetailPageModule in
D:/qrstore/src/pages/item-detail/item-detail.module.ts’. Please add a @Pipe/@Directive/@Component annotation.
at Error (native)
at syntaxError (D:\qrstore\node_modules@angular\compiler\bundles\compiler.umd.js:1729:34)
at D:\qrstore\node_modules@angular\compiler\bundles\compiler.umd.js:15625:40
at Array.forEach (native)
at CompileMetadataResolver.getNgModuleMetadata (D:\qrstore\node_modules@angular\compiler\bundles\compiler.umd.js:15607:54)
at addNgModule (D:\qrstore\node_modules@angular\compiler\bundles\compiler.umd.js:24403:58)
at D:\qrstore\node_modules@angular\compiler\bundles\compiler.umd.js:24414:14
at Array.forEach (native)
at _createNgModules (D:\qrstore\node_modules@angular\compiler\bundles\compiler.umd.js:24413:26)
at analyzeNgModules (D:\qrstore\node_modules@angular\compiler\bundles\compiler.umd.js:24288:14)

ionic info
@ionic/cli-utils : 1.12.0
ionic (Ionic CLI) : 3.12.0

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

@ionic/app-scripts : 3.0.0
Cordova Platforms  : android 6.2.3
Ionic Framework    : ionic-angular 3.7.1

System:

Android SDK Tools : 25.2.3
Node              : v6.9.4
npm               : 3.10.8
OS                : Windows 10

Misc:

backend : pro

item detail module

import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { ItemDetailPage } from './item-detail';
import { HttpModule, Http } from '@angular/http';

//native
import { File } from '@ionic-native/file';
import { FilePath } from '@ionic-native/file-path';
import { SQLite } from '@ionic-native/sqlite';

//providers
import { ItemsProvider, LabelsProvider, SQLiteDatabaseProvider } from '../../providers/providers';

//components
import { ItemCreatePage } from '../item-create/item-create';
import { QRCodeComponent } from 'ng2-qrcode'

//directive
import { AbsoluteDragDirective } from '../../directives/absolute-drag/absolute-drag';

@NgModule({
  declarations: [
    ItemDetailPage,
    QRCodeComponent,
    AbsoluteDragDirective
  ],
  imports: [
    IonicPageModule.forChild(ItemDetailPage),
    HttpModule
  ],
  exports: [
    ItemDetailPage
  ],
  entryComponents: []
  ,
  providers:[
    ItemsProvider,
    SQLite,
    SQLiteDatabaseProvider,
    File,
    FilePath
  ]
})
export class ItemDetailPageModule {}


#2