ng build --prod fails

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


1 Reply

AA Akshaya Arivoli Syncfusion Team August 17, 2020 11:44 AM UTC

Hi Mohamed,  

Thank you for contacting Syncfusion support. 

We are unable to reproduce the reported issue with the provided details. We have shared the sample in which we have tried in the below link, 


Note:  We have used the below commands, 
npm install 
ng build --prod 
npm 

Please try it and revert us with the modified sample, commends, replication procedure in which the issue could be reproduced. These details will be helpful for us to investigate further and assist you better. 


Regards,  
Akshaya  


Loader.
Up arrow icon