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.

Works locally, but on server preview shows loading ... and doesnt change.

See original GitHub issue

It works as expected when i run locally. But on my server it keeps saying loading PDF … Also locally i see there is a get request to the url to get the pdf file, but on the server there is no request to get the pdf from url.

Code:

this.state = {
      numPages: null,
      pageNumber: 1,
}

onDocumentLoadSuccess = ({numPages}) => {
    console.log(numPages);
    this.setState({numPages});
}

render() {
    return (
...
<Row>
          <Col xs={12}>
            Test Preview pdf.
          </Col>
          <Document
            file={"https://gsi.berkeley.edu/media/sample-recommendation-letter.pdf"}
            onLoadSuccess={this.onDocumentLoadSuccess}>
            <Page height={150} scale={1} pageNumber={1}
                  onLoadProgress={this.onLoadProgress}/>
          </Document>
</Row>
)
}

Local device: image

image

Server: image

and no requests to fetch pdf.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
NikkiTheBugSlayercommented, Apr 29, 2019

@cbaron That worked thanks

1reaction
cbaroncommented, Apr 3, 2019

A similar thing is happening to me.

import { Page, Document } from 'react-pdf/dist/entry.webpack';

No request is being made to get the worker.

Read more comments on GitHub >

github_iconTop Results From Across the Web

html - localhost Won't Immediately Update - Stack Overflow
First thing to try would be clearing browser history/cache and reloading the browser. If you enabled some kind ...
Read more >
Visual Studio Code Live Server Not Working - freeCodeCamp
Then, reopen VSCode and try again – go to the HTML file you want to view, right click, and select "Open with Live...
Read more >
Windows Admin Center common troubleshooting steps
This article describes how to diagnose and resolve issues in Windows Admin Center. If you're having an issue with a specific tool, ...
Read more >
Device Preview - Troubleshooting - Adobe Support
Unable to preview or inspect your web page on devices? Check these tips to troubleshoot issues with Device Preview in Dreamweaver.
Read more >
WordPress Changes Not Showing? Here's How to Fix ... - Kinsta
If the hard refresh didn't work, you might need to clear your browser's cache completely. This will wipe out all of the cached...
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