Uncaught TypeError: Cannot read properties of undefined (reading 'querySelector')

Which product are you using?

PDF.js Express Version

Detailed description of issue
When a document loads, the viewer throws a undefined error. This also happens when the mouse moves anywhere on the page. Document loads fine, but lags to render when scrolling down or back up.
I recently changed from @pdftron/pdfjs-express to @pdftron/pdfjs-express-viewer. I deleted all the previous files from pdfjs-express.
I am using blazor to develop.

Expected behaviour

Does your issue happen with every document, or just one?
Every document

Link to document

Code snippet
WebViewer_ = await WebViewer({
path: ‘pdfjsexpress/7.8.0’,
licenseKey: key
}, viewerElement).then(instance => {

        window.getBlob(request_options,  (blob, filename) => {
            try {
                instance.UI.loadDocument(blob, { filename: filename });
            }
            catch (e) {
                console.log(e)
            }
        })

    })

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:

Guides:APIs:Forums:

Found temp solution: PDF Viewer React sample has error - #3 by dfelix

Hello rbramasco,

The fix will be fixed in our next version which should be this month. Thank you for your patience!

Best regards,
Tyler Gordon
Web Development Support Engineer
PDFTron


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

Is there any news on this error? I tested this on 8.4 as well, same issue

1 Like

Hello rbramasco,

I was unable to reproduce this error on our latest version.

Best regards,
Tyler Gordon
Web Development Support Engineer
PDFTron


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here