Hello All,
ng build --prod fails
Error :
ERROR in Type PdfViewerComponent in D:/Work/Barcode client only/node_modules/@syncfusion/ej2-angular-pdfviewer/ej2-angular-pdfviewer.d.ts is part of the declarations of 2 modules: TemplatesModule in D:/Work/Barcode client only/src/app/templates/template.module.ts and PdfViewerModule in D:/Work/Barcode client only/node_modules/@syncfusion/ej2-angular-pdfviewer/ej2-angular-pdfviewer.d.ts! Please consider moving PdfViewerComponent in D:/Work/Barcode client only/node_modules/@syncfusion/ej2-angular-pdfviewer/ej2-angular-pdfviewer.d.ts to a higher module that imports TemplatesModule in D:/Work/Barcode client only/src/app/templates/template.module.ts and PdfViewerModule in D:/Work/Barcode client only/node_modules/@syncfusion/ej2-angular-pdfviewer/ej2-angular-pdfviewer.d.ts. You can also create a new NgModule that exports and includes PdfViewerComponent in D:/Work/Barcode client only/node_modules/@syncfusion/ej2-angular-pdfviewer/ej2-angular-pdfviewer.d.ts then import that NgModule in TemplatesModule in D:/Work/Barcode client only/src/app/templates/template.module.ts and PdfViewerModule in D:/Work/Barcode client only/node_modules/@syncfusion/ej2-angular-pdfviewer/ej2-angular-pdfviewer.d.ts.
I've imported pdf viewer in module and I need to import it again in ts file to use as element ref.
My code snippets:
component.ts

Module:

This setup is working in ng serve and ng build but fails in ng build --prod. Please advise ?
NPM : 6.4.1
Node: 10.15.3
@syncfusion/ej2-angular-pdfviewer": "^18.1.55",
Thanks,
Mohamed