TypeScript error: Cannot read properties of undefined (reading 'parentElement')

Hello people,

I found what I think is a bug in the PDF Viewer javascript control. I'm using version 20.1.0.56.

The problem seems to be somewhat specific to the context and the type of PDF being viewed, because this happens when testing the PDF Viewer with de 'Mobile emulator' switch turned on in dev tools of Chrome. I didn't test it in a real mobile device yet.

The error happens here (see the 'mobile emulator' button is blue/activated):

Pdfviewer-bug-01.jpg

The problem does NOT happen with any PDF file, but the ones that have some sort of restriction, as can be seen in this image:

Pdfviewer-bug-02.jpg


It seems that PDF files with no restrictions at all avoid the code flow to the function that doesn't have reference of 'parentElement'. Also, viewing the PDF in desktop browser mode doesn't seem to fail either.

Please, can you confirm this?


Thanks in advance, regards!

Alex



10 Replies

VS Vasugi Sivajothi Syncfusion Team May 23, 2022 04:15 PM UTC

Hi Alejandro,


We have tried to replicate the reported issue with multiple documents. But unable to replicate the reported issue on our end. We have shared the sample in which we have tried to reproduce the issue, please refer to the below link.


Sample: https://stackblitz.com/edit/yufjn2?file=index.ts

Web service: https://www.syncfusion.com/downloads/support/directtrac/general/ze/WEBSER~11864044006


However, the reported issue seems to the document specific. Could you please share the PDF document in which you have reproduced the issue? This will be helpful to investigate further and provide the solution at the earliest.


Regards,

Vasugi.



AL Alejandro May 23, 2022 09:28 PM UTC

Hello Vasugi,


I'm attaching a sample PDF that has restriction, so you can check it at your end.


Thank you

Alex



Attachment: PdfViewerSampleForMobileView_be366723.zip


SK Shamini Kiruba Sobers Syncfusion Team May 25, 2022 05:47 PM UTC

Hi Alex,


Thanks for sharing the file. We will check and update the details tomorrow (May 26, 2022).


Regards,

Shamini



SK Shamini Kiruba Sobers Syncfusion Team May 26, 2022 05:06 PM UTC

Hi Alex,


We were able to replicate the reported issue “TypeScript error: Cannot read properties of undefined (reading 'parentElement') is thrown on loading the specific document in mobile devices”. We will validate it and update further details in two business days on May 30, 2022.


Regards,

Shamini



SK Shamini Kiruba Sobers Syncfusion Team May 30, 2022 04:36 PM UTC

Hi Alex,


We have validated the issue “TypeScript error: Cannot read properties of undefined (reading 'parentElement') is thrown on loading the specific document in mobile devices” and logged it as a defect. The fix for the issue will be available in our upcoming weekly NuGet release on June 22, 2022. You can track the status of the issue through the following link.


Feedback: https://www.syncfusion.com/feedback/35274/typescript-error-cannot-read-properties-of-undefined-reading-parentelement-is


Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”


Regards,

Shamini



SK Shamini Kiruba Sobers Syncfusion Team June 22, 2022 03:42 PM UTC

Hi Alex,


Sorry for the inconvenience. The fix was not included in our latest weekly NuGet release. However, we will include the fix in our upcoming weekly NuGet release without further delay on July 6, 2022.


Regards,

Shamini



CK Chinnamunia Karthik Chinna Thambi Syncfusion Team July 7, 2022 10:23 AM UTC

Hi  Alejandro,


Sorry for the inconvenience. The fix was not included in our latest weekly NuGet release. However, we will include the fix in our upcoming weekly NuGet release without further delay on July 13, 2022.


Regards,
CCM Karthik



CK Chinnamunia Karthik Chinna Thambi Syncfusion Team July 14, 2022 01:48 PM UTC

Hi  Alejandro,


We have fixed the reported issue  and the fix for the reported issue was included in our latest weekly release v20.2.0.38. Kindly upgrade to that version to get the issue resolved.


Packages:   

Service side package

ASP.NET Core :      

https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Core.Windows/ 

https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Core.Linux/       

https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Core.OSX/      

       

ASP.NET MVC:      

https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Mvc5/      

https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Mvc4/


CDN:    https://cdn.syncfusion.com/ej2/20.2.38/dist/ej2.min.js

https://cdn.syncfusion.com/ej2/20.2.38/material.css


Regards,

CCM Karthik



AL Alejandro July 16, 2022 10:09 PM UTC

Hello! 


I've tested the issue with the latest SF components, and the problem seems to be resolved.


Thank you very much!

Regards

Alex



CK Chinnamunia Karthik Chinna Thambi Syncfusion Team July 18, 2022 06:13 AM UTC

Hi Alex,


Thank you for the response.

Regards,
CCM Karthik


Loader.
Up arrow icon