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

main.worker.js? #7827

Closed
mark-norgate opened this issue Nov 18, 2016 · 2 comments
Closed

main.worker.js? #7827

mark-norgate opened this issue Nov 18, 2016 · 2 comments
Labels

Comments

@mark-norgate
Copy link

mark-norgate commented Nov 18, 2016

I have built pdf.js in accordance with these instructions. The code generated includes this line:

var worker = new Worker(workerSrc);

Chrome is complaining that it cannot find the file GET http://localhost:8100/build/main.worker.js.

Now then, I have not come across web workers before, so I'm not sure what this error means or where to find, or build, this file. I notice that the build process also yields a file called pdf.worker.js, and I have strong suspicions that this might be the file it's after, although renaming it to main.worker.js had no effect.

I'm sure this is a very simple problem if you are in the know. What am I missing?


Ok, after a little more digging, I found this which pertains more to my situation. I am using Ionic 2 and I don't know how to generate the file referenced in this line:

pdfjsLib.PDFJS.workerSrc = '../../build/webpack/pdf.worker.bundle.js';

Can anyone illuminate my dark mind?

@agilgur5
Copy link

agilgur5 commented Jan 12, 2017

@mark-norgate you'd probably find the information in the issue I previously filed helpful. See also #7683

@yurydelendik
Copy link
Contributor

What am I missing?

You need to specify PDFJS.workerSrc or PDFJS.workerPort. Using 'pdfjs-dist/webpack' with provide workerPort automatically (see #8107). Closing as answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants