PDFTron lib is not working on Angular 13

WebViewer Version: @pdftron/webviewer : “^6.3.3”
Angular version : 13.3.10

Error :
On UI when we click on view or edit pdf button then we are getting “Error: Uncaught (in promise): TypeError: pdftron_webviewer__WEBPACK_IMPORTED_MODULE_0_ is not a function” in browser console. After upgrading from angular 11 to 13 we started getting this error. PFA

can you please help us asap to resolve this issue as our project angular upgradation is pending due to this pdftron error.

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:


Hello mrunali.yadav,

Thank you for reporting this issue.

I’ve tried creating a new Angular Project using Angular 13 and following our guide on how to set up WebViewer but I haven’t seen the same error using WebViewer 8.6. I also tried with WebViewer 6.3 as it is closer to the version you are using but we don’t have a “view or edit pdf button” like the one you are referring to. I think this error might be caused by a pathing issue somewhere in your app’s code, perhaps with a custom button, but it’s hard to diagnose without being able to reproduce it. Would you be able to share a sample project where the issue can be reproduced?

Alternatively, after a quick search I came across a stackoverflow topic that seems to have a potential workaround for a similar error due to a webpack issue. It could be worthwhile to try this just in case it works with your current code.

Best Regards,

Carlo Mendoza
Software Developer
PDFTron Systems, Inc.

Thank you @cmendoza issue is resolved now.