-
-
Notifications
You must be signed in to change notification settings - Fork 963
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Before you start - checklist
- I followed instructions in documentation written for my React-PDF version
- I have checked if this bug is not already reported
- I have checked if an issue is not listed in Known issues
- If I have a problem with PDF rendering, I checked if my PDF renders properly in PDF.js demo
Description
Hi 👋
react-pdf
currently depends on an older version of pdfjs-dist
.
The PDF.js team recently merged mozilla/pdf.js#20148, which fixes an important Safari compatibility issue:
FinalizationRegistry
is only available in Safari 14.1+.- It cannot be polyfilled.
- Without this fix,
pdfjs-dist
fails to work on older Safari versions (e.g. Safari 12, 13).
The fix defers initialization of IccColorSpace.#finalizer
until after IccColorSpace.isUsable
is checked, allowing custom builds to still run in legacy browsers.
Why this matters
- Many users of
react-pdf
need to support Safari < 14.1. - Manually installing a newer
pdfjs-dist
causes version mismatch errors (API version … does not match Worker version …
). - The only stable solution is for
react-pdf
to bump itspdfjs-dist
dependency to the latest version containing this fix.
Expected outcome
Please update the pdfjs-dist
dependency in react-pdf
to at least the version that includes PR #20148.
This will restore compatibility with Safari < 14.1 and prevent breaking apps in production.
Thanks for your great work on maintaining this library 🙏
Steps to reproduce
- Install
react-pdf
in a project. - Open a PDF in Safari 12 or 13.
- Observe the console or app crash due to
FinalizationRegistry
being undefined.
Expected behavior
- PDF should load and render normally in Safari 12 and 13 without errors.
react-pdf
should work in legacy browsers even thoughFinalizationRegistry
is unavailable.
Actual behavior
- PDF rendering fails in Safari 12/13.
- The console shows an error like
ReferenceError: FinalizationRegistry is not defined
. - The app may crash or the PDF does not display.
Additional information
No response
Environment
No response
aminrzaei and LifeLike1
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request