wojtekmaj / react-pdf

Display PDFs in your React app as easily as if they were images.
https://projects.wojtekmaj.pl/react-pdf
MIT License
9.11k stars 867 forks source link

Text layer crash in Safari iOS #1655

Closed lksnmnn closed 3 weeks ago

lksnmnn commented 9 months ago

Before you start - checklist

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

  1. Implement latest version
  2. open example PDF
  3. See worker crash on iOS safari.

Expected behavior

Does not crash :)

Actual behavior

Crashes

Additional information

media-d7734040-c661-442c-8d0f-ecb1e3a59c4c.pdf

Environment

lksnmnn commented 9 months ago

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 :)

NIticache commented 6 months ago

Can I know which version you downgraded to , i am currently using 6.2.2

lksnmnn commented 4 months ago

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 ?!.

github-actions[bot] commented 1 month ago

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.

github-actions[bot] commented 3 weeks ago

This issue was closed because it has been stalled for 14 days with no activity.

Ladvace commented 2 weeks ago

does downgrading fix the problem? I have the same issue with the last version of react-pdf