Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset fetching fails for some assets, when many assets are present #1894

Open
4 tasks done
Mirthis opened this issue Oct 3, 2024 · 1 comment
Open
4 tasks done

Asset fetching fails for some assets, when many assets are present #1894

Mirthis opened this issue Oct 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Mirthis
Copy link

Mirthis commented Oct 3, 2024

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

I'm currently generating large documents on the server and I'm embedding images from a blob storage (Vercel blob).
When lots of images are present, I can see some of the images on the later part of the document being dropped (appearing as empty) and several of the following errors in the log request to https://....png failed, reason: (with the reason being actually empty).

I've tried to filter out the input to generate only a subset of the document and all the images (including the one that are dropped when creating the full document) are properly included.

I wonder if this may be down to to the number of asset requests that are triggered at the same time, assuming these all happen in parallel, but I'm just guessing.

To clarify further I'm using renderToStream to generate my output and subsequently store this on a file.

Steps to reproduce

I don't have a replicable example I'm afraid as I cannot just publish the same code and data I'm using, and recreating a similar one from scratch is going to be non-trivial. I can share code snippets and other info if needed.

Expected behavior

I expect all assets to be retrieved correctly.
Or to be able to configure the fetching process to avoid the receiver being overwhelmed.
Alternatively a way to split the document generation in chuncks would also work.

Actual behavior

Fetching of some of the assets fails during the rending process.

Additional information

No response

Environment

  • Browser (if applicable):
  • React-PDF version:
  • React version:
  • Bundler name and version (if applicable):
@Mirthis Mirthis added the bug Something isn't working label Oct 3, 2024
@Mirthis Mirthis changed the title Asset fetching fail for some assets, when many assets are present Asset fetching fails for some assets, when many assets are present Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
@Mirthis and others