-
Notifications
You must be signed in to change notification settings - Fork 228
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
Worker was destroyed #389
Comments
Can you let me know how to reproduce the issue? |
|
Where do you put the |
In modal , |
You should put the const App = () => {
return (
<Worker
workerUrl="https://unpkg.com/pdfjs-dist@2.5.207/build/pdf.worker.min.js"
>
...
</Worker>
);
};
render(<App />, document.getElementById('root')); |
OK, |
@phuoc-ng Found related issues |
Same issue, even when the worker is placed at the root. |
The issue is that the pdf.worker.min.js is called multiple times so the message "Worker was destroyed" is present while the pdf.worker.min.js is pending. |
For anyone who needs this in the future, |
@David-moonsite Reason By default, for each document pdf.js will create a web worker to parse and render the document. Let's say that we have 3 documents, and there are 2 buttons, Next and Previous to load the previous and next document. When user clicks the Next button, it then destroys the In order to fix that, I create and destroy the worker manually. |
@David-moonsite |
Done, but now the top toolbar is gone ( download, zoom etc.... ) |
Hi ,
sometimes i get "Worker was destroyed",
why is it happening
The text was updated successfully, but these errors were encountered: