Hi,
I don't know how to reproduce precisely the bug, but when navigating from a page (WASM) with a PDF Viewer component, I sometimes have a JavaScript error that occurs every milliseconds and never stops.
Here is the error :
Uncaught TypeError: Cannot read properties of null (reading 'getBoundingClientRect')
It mentions this code in the minified syncfusion-blazor-spdfviewer.min.js :
(!sf.base.Browser.isDevice || this.enableDesktopMode) && this.toolbarModule && this.viewerBase.navigationPane && this.enableNavigationToolbar) { var r = 0; i = setInterval((function() { var e = t.element.querySelector(".e-pv-toolbar").getBoundingClientRect().height; r++, (e <= 200 || r >= 5) && (t.viewerBase.navigationPane.adjustPane(), i && (clearInterval(i), i = null)) } ), 100) } |
Please check if you can add a condition before calling getBoundingClientRect().
Regards.
Hi Julien Barach,
Thank you for the update. We were able to reproduce the reported issue "Exception throws when suddenly navigate away from PDF Viewer in WASM". We suspect this to be a defect and will perform further analysis. We will update you with more details by June 9, 2025.
Regards,
Venkada Subramanian Durai
Hi Julien Barach,
Thank you for your patience. We have confirmed the issue "Exception throws when suddenly navigate away from PDF Viewer in WASM" and logged it as a defect.
We will include the fix in our weekly NuGet release, which is estimated to be available on July 1,2025.
Feedback: Exception throws when suddenly navigate away from PDF Viewer in WASM
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."
Hi Julien Barach,
Thank you for your patience. We have fixed the reported issue "Exception throws when suddenly navigate away from PDF Viewer in WASM" and the fix for the reported issue was included in our latest weekly release v30.1.38. Kindly upgrade to that version to get the issue resolved.
Root cause: Sudden navigation of component when the toolbarContainer is not created then accessing the toolbarContainer.getBoundingClientRect() cause exception
Solution: Added proper null check before accessing the toolbarContainer
Packages:
|
CDN Links:
https://cdn.syncfusion.com/blazor/30.1.38/styles/bootstrap5.css
https://cdn.syncfusion.com/blazor/30.1.38/syncfusion-blazor-sfpdfviewer.min.js