react-pdf
react-pdf copied to clipboard
Text layer crash in Safari iOS
Before you start - checklist
- [X] I followed instructions in documentation written for my React-PDF version
- [X] I have checked if this bug is not already reported
- [X] I have checked if an issue is not listed in Known issues
- [X] If I have a problem with PDF rendering, I checked if my PDF renders properly in PDF.js demo
Description
I have updated from 6.2.2 to the latest version (7.5.1). While it does work in browsers, it crashes for some (!) PDFs in Safari on iOS. This happens both on 15.X and 16.X iOS devices.
I can't really narrow down, why some PDFs work and others do not. The crash happens in pdf-js when trying to render the text layer:
TypeError: null is not an object (evaluating 'this._transport.messageHandler.sendWithStream')
streamTextContent — 2b7b2d2a.c91375ee806f06d5.js:1400:84
I assume that this is probably a bug in either pdf-js or some error in Safari. However, it might be something else thus I have opened this ticket here.
Steps to reproduce
- Implement latest version
- open example PDF
- See worker crash on iOS safari.
Expected behavior
Does not crash :)
Actual behavior
Crashes
Additional information
media-d7734040-c661-442c-8d0f-ecb1e3a59c4c.pdf
Environment
- Browser (if applicable): Safari 15.X, Safari 16.X (latest)
- React-PDF version: 7.5.1 (also tried 7.3.3)
- React version: 18.2.0
- Webpack version (if applicable): 5.89.0
Also I just saw, that "modern" pdf-js does not support Safari at all. Will try the "legacy" version, else I will downgrade for now :)
Can I know which version you downgraded to , i am currently using 6.2.2
Hey, sorry for the late reply. I've downgraded to 6.2.2.
I haven't tried the latest version, but I guess the issue is with pdf-js
?!.
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.
This issue was closed because it has been stalled for 14 days with no activity.
does downgrading fix the problem? I have the same issue with the last version of react-pdf