-
Notifications
You must be signed in to change notification settings - Fork 441
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
pdfjs es5 version issue #155
Comments
I think the way to go is to update to the latest PDF.js, however there are problems with highlight rendering: #154. |
Hi @agentcooper, do you mean update the dependency or a line import PDFWorker from "worker-loader!pdfjs-dist/build/pdf.worker? |
HI @agentcooper , any updates I got the same issues |
@jinman @hdminh247 I've published |
@agentcooper after upgrading to
|
@hdminh247 yes, you need to setup the PDF.js worker, see ./example/src/index.tsx. |
@agentcooper it does not works even setup PDF.js worker like above, same warning issues, the pdf still be shown as blank |
I'm also getting the same errors even though I've defined |
@agentcooper also is there any way to hide emoji on highlight comment ? |
@hdminh247 @johnn134 what setup are you using? is it Create React App? |
I've published 5.2.0 which does not require external workerSrc config: 7bb025a. |
@agentcooper yes the issue appears with create-react-app. I've additionally used react-app-rewired to utilitize worker-loader to get react-pdf-highlighter 4.0.0 working in my app. I've tried setting In the meantime, I'm sticking with version 4.0.0 since I could get it working by forcing pdfjs-dist to version |
@johnn134 Would you be able to provide a reproducible example on CodeSandbox or a repo? I have an example with CRA in ./create-react-app-example and it seems to work fine. |
@agentcooper I wonder if this is a case of "works on my machine but not yours". When I clone this repo and run the create-react-app-example it errors out immediately before even running the app. I've run I wonder if there is a global package you're using locally that allows the CRA version to run correctly. Otherwise, the issue is with me here and I can't find the problem yet with how I've setup your repo. The base example ran from the repo root is fine, but the CRA example causes these errors after compilation:
|
@johnn134 I think you're missing |
@agentcooper running build fixed the example. I'll compare the example to my local app to see what the issue with workerSrc is. Adding the build step to the README could help other people struggling to get the CRA example running. Thanks for responding quickly lately. |
@johnn134 Sure, no problem. I've updated README.md in ./create-react-app-example. Let me know once you find the issue. |
@agentcooper thanks, it's working with the latest release now. very appreciate it 🙏 Btw could you let me know if there any way to hide emoji on highlight comment ? |
@agentcooper Version 5.2.0 is working great with my local app now, thanks for the help |
@hdminh247 please see #44 |
Hi @agentcooper,
Thanks again for the great library.
We noticed that two issues:
Other people are also complaining about this:
https://stackoverflow.com/questions/67114898/additional-loader-for-pdfjs-dist-in-react-app
or
mozilla/pdf.js#12905
Any help will be highly appreciated
The text was updated successfully, but these errors were encountered: