question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Regression from 4.2.0 to 5.2.0 in loading pdf from ArrayBuffer?

See original GitHub issue

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 Mozilla Firefox

Description

Short description of the bug you encountered.

Updating the version from 4.2.0 to 5.2.0 broke my code, but I couldn’t find anything about a breaking change in the doc.

Steps to reproduce

  1. get the pdf file content as content
  2. return <Document file={Buffer.from(content, 'binary').buffer}><pageNumber={1} /></Document>
  3. Try with v4.2.0 -> works
  4. Try with v5.2.0 -> failed to load pdf file

If it’s necessary I can try to create a project to reproduce

Expected behavior

What you expected to happen?

Should show the pdf in the last version

Additional information

If applicable, add screenshots (preferably with browser console open) and files you have an issue with to help explain your problem.

Environment

  • Browser (if applicable) [e.g. Chrome 57, Firefox 59]: Firefox 86.0 (64 bits)
  • React-PDF version [e.g. 3.0.4]: 5.2.0
  • React version [e.g. 16.3.0]: 16.13.1
  • Webpack version (if applicable) [e.g. 4.16.2]: 4.44.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Sharcouxcommented, Mar 1, 2021

@wojtekmaj I’ve just tried with 5.1.0 and 5.0.0 to no avail. I’ll try to create a repro. I’m just not sure if I can do it this week. Thanks a lot 😉

0reactions
Sharcouxcommented, Sep 4, 2021

Actually, I was using a non-matching version of pdf.worker.js. I’m still not sure on how and why. But using the mentioned import for webpack users quickly solved the issue:

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Blog - Apache Cordova
Apache Cordova apps built for Android devices which allow the loading of http content from domains they do not control could be affected....
Read more >
PDF-LIB · Create and modify PDF documents in any ...
Create PDF documents from scratch, or modify existing PDF documents. Draw text, images, and vector graphics. Embed your own fonts. Even embed and...
Read more >
Changelog
Fixed a regression in 10.11.0 where the Launchpad no longer showed a loading spinner on startup to indicate that it had successfully started...
Read more >
node packages | Corvid by Wix
csv-converter-to-pdf-and-html. 1.0.2. available. 12/28/2022 ... base64-arraybuffer ... 4.2.0. available. 05/03/2022. node-rate-limiter. 1.0.1. available.
Read more >
Open Source Used In CloudCenter SA 5.2.4
1.1994.1 Available under license. 1.1995 python-cinderclient 4.2.0 ... 1.2595 postcss-load-config 2.0.0 ... 1.2631 safe-buffer 5.2.0.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found