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

Infinite loop? might be a bug but im not sure #570

Closed
nexeh opened this issue May 12, 2020 · 1 comment
Closed

Infinite loop? might be a bug but im not sure #570

nexeh opened this issue May 12, 2020 · 1 comment

Comments

@nexeh
Copy link

nexeh commented May 12, 2020

I'm not sure what has changed but it's a little guidance on what might cause this could be useful. It seems like this project is infinitely requesting the PDF from the URL. My initial feeling was that this might be a defect on your side but I can't seem to see any changes that came into my project from you which leads me to believe maybe I'm returning data in a different way and it results in this behavior and I was hoping that you might point me in the right direction?

What are you trying to achieve? Please describe.

I have an existing application that uses this project to display PDF's that I have stored in S3. Haven't made any changes here that I'm aware of. pretty bland/straight-forward:

<div className="modal-body">
                  <form>
                    <Document
                    file={{url: this.state.pdfUrl}}
                    onLoadSuccess={this.onDocumentLoadSuccess}
                    >
                      <Page pageNumber={pageNumber} />
                    </Document>
                  </form>
                </div>

Describe solutions you've tried

first part of my process is I request a pre signed URL that I normally pass here for PDFurl but to simplify things I just hard-coded the URL. If I take the pre-signed URL it opens and downloads fine however the above code seems to make an infinite amount of request to receive the PDF. All of them returning a status 200 and I have to reload the page to get it to stop.

I have also confirmed that my code isnt setting the state of the application more than once.

Environment

  • Browser: Chrome Version 81.0.4044.138 (Official Build) (64-bit)
  • React-PDF version "react-pdf": "^4.1.0",
  • React version [e.g. 16.3.0]: "react": "^16.12.0",
@wojtekmaj
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants