mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.12k stars 9.94k forks source link

[Bug]: Safari fails to render page due to "ReferenceError: Can't find variable: Tr" #18608

Closed thekeyunlocks closed 1 month ago

thekeyunlocks commented 1 month ago

Attach (recommended) or Link to PDF file

I have a website (getsesha.com) where I use pdf-js. It works in all other browsers, but when I use safari, i get a blank white page.

If I open up the javascript developer console, I see: ReferenceError: Can't find variable: Tr (from line 161 in annotation-editor-layer.js, from line 158 in same)

if I reload the page with the javascript developer console open, it magically works and my page renders? but if i close the console and then refresh, it goes back to being a white screen.

Web browser and its version

Safari

Operating system and its version

macOS Monterery 12.7.5

PDF.js version

4.3.136

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

go to getsesha.com note the white screen open developer->javascript console note the reference error for Tr refresh the page mysteriously, works.

What is the expected behavior?

that the page loads normally without an error.

Screen Shot 2024-08-14 at 3 41 13 PM

What went wrong?

error:

Screen Shot 2024-08-14 at 3 36 40 PM

fixed?

Screen Shot 2024-08-14 at 3 37 25 PM

Link to a viewer

No response

Additional context

i'm using vue3 as well. i believe the js error is causing the whole page to fail

Snuffleupagus commented 1 month ago

Unfortunately you've not filled out the issue template correctly and completely, and thus it's generally impossible to help.

Attach (recommended) or Link to PDF file

I have a website (getsesha.com) where I use pdf-js. It works in all other browsers, but when I use safari, i get a blank white page.

If I open up the javascript developer console, I see: ReferenceError: Can't find variable: Tr (from line 161 in annotation-editor-layer.js, from line 158 in same)

if I reload the page with the javascript developer console open, it magically works and my page renders? but if i close the console and then refresh, it goes back to being a white screen.

Unfortunately none of this context makes sense under a heading called Attach (recommended) or Link to PDF file.

Web browser and its version

Safari

This is missing the version number, please also note https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support

PDF.js version

4.3.136

That version is no longer supported, please find the latest releases at https://mozilla.github.io/pdf.js/getting_started/#download

Is the bug present in the latest PDF.js version?

Yes

Sorry, but did you actually check this?

Steps to reproduce the problem

go to getsesha.com note the white screen open developer->javascript console note the reference error for Tr refresh the page mysteriously, works.

Unfortunately this sounds like a browser bug, and note that the FAQ only lists Safari as Mostly supported.

Please also see https://github.com/mozilla/pdf.js/blob/master/.github/CONTRIBUTING.md (emphasis mine):

If you are developing a custom solution, first check the examples at https://github.com/mozilla/pdf.js#learning and search existing issues. If this does not help, please prepare a short well-documented example that demonstrates the problem and make it accessible online on your website, JS Bin, GitHub, etc. before opening a new issue or contacting us in the Matrix room -- keep in mind that just code snippets won't help us troubleshoot the problem.