-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
No PDFJS.workerSrc specified error on using pdfjs-dist package from npm #8204
Comments
As fcfort commented, it works when i use
|
Go to pdf.js search function getWorkerSrc() replace this lines pdfjsFilePath = "YOUR_PATH_TO_JS_FILE/pdf.worker.js"; |
That's not a work-around, but actually the correct solution! Please keep in mind that even though we attempt to obtain a fallback path, there's no simply no guarantee that it will be successful if the Closing as answered. |
You should try this:
|
Regarding that documentation. I'm trying to follow it. I'm not God's gift to programming, but I'm not always the dumbest guy in the room either. I am having a difficult time making heads or tails of this paragraph in the documentation: RE: https://github.com/mozilla/pdf.js/wiki/Setup-pdf.js-in-a-website
It seems to have a typo at least, but even if that is fixed, this is not very clear to me. It might reduce some frustration and wasted time answering questions if more explanation can be put around this bit. Thanks! ☕ |
This absolutely worked for me, except I'm using native
|
i have preferred import with an await to split the bundle, this lib is kinda heavy |
Yeah. Either way. The concept is the same. I'm just glad I found your comment because it helped me resolve this problem rather quickly. :) |
I added a simple create-react-app example on this PR |
- added worker-loader dependency (required) - https://github.com/mozilla/pdf.js/blob/1a2cdaffc513385fc2f17d0e53d2643f92d5fa81/examples/webpack/main.js - mozilla/pdf.js#8204 (comment) - https://github.com/luistak/pdf.js/blob/ffa57e94da1cb835688e225543a968106cd7d6e5/examples/create-react-app/src/pdf.tsx
Is it possible to add a TypeScript type definition to this package for the |
implemented as shown in the example for node, but throws error for not specifying workingSrc.
I'm using content scripts for a chrome extension which disallow document.currentscript as fcfort commented in this issue
The text was updated successfully, but these errors were encountered: