react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

Text layer crash in Safari iOS

Open lksnmnn opened this issue 1 year ago • 4 comments

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

  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

  • 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

lksnmnn avatar Oct 26 '23 07:10 lksnmnn

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

lksnmnn avatar Oct 26 '23 07:10 lksnmnn

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

NIticache avatar Jan 10 '24 06:01 NIticache

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

lksnmnn avatar Mar 25 '24 14:03 lksnmnn

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] avatar Jun 24 '24 00:06 github-actions[bot]

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

github-actions[bot] avatar Jul 15 '24 00:07 github-actions[bot]

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

Ladvace avatar Jul 18 '24 08:07 Ladvace