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

PDF not rendering despite onLoadSuccess triggered #360

Closed
acollazomayer opened this issue Feb 23, 2019 · 21 comments
Closed

PDF not rendering despite onLoadSuccess triggered #360

acollazomayer opened this issue Feb 23, 2019 · 21 comments
Assignees
Labels
question Further information is requested stale

Comments

@acollazomayer
Copy link

Hi Im having a problem. I load a pdf with this library. The onLoadSuccess is triggered. But the Document does not render.

I dont know what else to do. I just copy the example page.

Thanks

@wojtekmaj
Copy link
Owner

Any errors in the console?

@wojtekmaj wojtekmaj added the question Further information is requested label Feb 24, 2019
@acollazomayer
Copy link
Author

@wojtekmaj. No no errors on console. It might be a stupid thing. But its driving me crazy. There is nothing indicating that something goes wrong. The on error functions are not being called either.

@niktnikt
Copy link

I have a similar issue. Instead of rendering the Pdf it says "Failed to load PDF file"
In the console i get:

pdf.worker.js:1 Uncaught SyntaxError: Unexpected token <
index.js:1446 Error: Setting up fake worker failed: "Cannot read property 'WorkerMessageHandler' of undefined".
at eval (pdf.js:11664)

@BF-man
Copy link

BF-man commented Feb 26, 2019

Have the same issue. No errors at all. Some of pdf are rendered correctly, some not just white canvas instead of pages

@wojtekmaj
Copy link
Owner

@niktnikt See #52, #321

If others have this precise message also see these issues I mentioned above.

@wojtekmaj wojtekmaj changed the title Pdf is not rendering. PDF not rendering despite onLoadSuccess triggered Feb 26, 2019
@AmyshaDixon
Copy link

I have the same issue and it is very. very. frustrating.

@acollazomayer
Copy link
Author

@AmyshaDixon yeah, I decided not to render anything.

@AmyshaDixon
Copy link

@acollazomayer I ended up using react-pdf-js instead just until this issue gets fixed. It doesn't have all the bells and whistles that this one does, but it gets the job done in the meantime.

@wojtekmaj
Copy link
Owner

If the issues mentioned are not helpful at all, and you don't see any errors in the console, or any network errors, check this Wiki entry:

https://github.com/wojtekmaj/react-pdf/wiki/Frequently-Asked-Questions#i-render-document-but-nothing-is-rendered-why

If that fails too, I'm going to need a minimum reproduction on something like CodeSandbox.

@wojtekmaj wojtekmaj self-assigned this Mar 20, 2019
@jaquesgrobler
Copy link

If it's of any help to anyone, I had the exact problem - no errors, but nothing rendering.

Added

<Page pageNumber={1} />

And it worked. Thanks @wojtekmaj for the links

@balu4k

This comment has been minimized.

@Ashutoshsardesai
Copy link

index.js:1375 Error: Setting up fake worker failed:
how do i fix this? plz help me i am stuck with this.

@wojtekmaj

This comment has been minimized.

@JaredClayborn
Copy link

@jaquesgrobler Thanks, that worked.

@rizwan92
Copy link

it occurs when we do ssr at backend and then server the page

@WebXPujan
Copy link

If it's of any help to anyone, I had the exact problem - no errors, but nothing rendering.

Added

<Page pageNumber={1} />

And it worked. Thanks @wojtekmaj for the links

yes adding inside component works like a charm

@tskweres
Copy link

tskweres commented Aug 4, 2021

I have tried everything, pageNumber={1} etc.

No errors, nothing renders :(

@Muhamed23
Copy link

@tskweres add this one

import { pdfjs } from 'react-pdf';
pdfjs.GlobalWorkerOptions.workerSrc = //cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.min.js;

@github-actions
Copy link
Contributor

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 github-actions bot added the stale label Jul 11, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2022

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

@github-actions github-actions bot closed this as completed Aug 1, 2022
@tuannguyensn2001
Copy link

If it's of any help to anyone, I had the exact problem - no errors, but nothing rendering.

Added

<Page pageNumber={1} />

And it worked. Thanks @wojtekmaj for the links

that works for me, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested stale
Projects
None yet
Development

No branches or pull requests