You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked sample and test suites to see real life basic implementation
I have checked if this question is not already asked
What are you trying to achieve? Please describe.
I have the implementation working successfully locally, but when I view it in a production environment, the PDF is not rendering. The file is retrieved from my API successfully, but the PDF viewer will not display it. No errors are thrown, the page numbers are displayed correctly, and a message is logged on load success.
Locally, everything works great.
Production, no errors are thrown, but the PDF is not rendered/displayed. Just a blank white screen, with correct page numbers.
Environment
Browser (if applicable): Version 72.0.3626.121
React-PDF version [e.g. 3.0.4]: 4.0.5
React version [e.g. 16.3.0]: 16.8.5
Webpack version (if applicable) [e.g. 4.16.2]: 4.29.6
The text was updated successfully, but these errors were encountered:
@samkim28 did you end up fixing this? I have a similar issue at my work. Tried a couple of things, including setting the "pdfjs.GlobalWorkerOptions.workerSrc" but while everything works locally, nothing works on production. Had to take out react-pdf.
@bot19 I was reviewing any changes I had from my code above, and the two differences I have are hardcoding the pdf.js version in the script src, and importing pdfjs from 'react-pdf', while I import Document, Page from entry.webpack. Hope this helps!
Before you start - checklist
What are you trying to achieve? Please describe.
I have the implementation working successfully locally, but when I view it in a production environment, the PDF is not rendering. The file is retrieved from my API successfully, but the PDF viewer will not display it. No errors are thrown, the page numbers are displayed correctly, and a message is logged on load success.
Describe solutions you've tried
Index.html
I commented out the pdfjsWorker.workerSrc line because for some reason it wasn't working nicely.
Component
added worker src inside the component.
Webpack
Locally, everything works great.
Production, no errors are thrown, but the PDF is not rendered/displayed. Just a blank white screen, with correct page numbers.
Environment
The text was updated successfully, but these errors were encountered: