question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Worker was destroyed

See original GitHub issue

Getting this error when I go to another component and come back to the component that includes the pdf. It works fine on first visit to the component.

Error: Worker was destroyed at _fetchDocument (eval at <anonymous> (app.js:6530), <anonymous>:2541:27) at eval (eval at <anonymous> (app.js:6530), <anonymous>:2527:12) at <anonymous>

I tried to reproduce it with this jsfiddle, but couldn’t get the same error…

Any ideas?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
FranckFreiburgercommented, Aug 2, 2017

@ChenMachluf thanks for your fix ! Since several people are waiting for this fix, I commit your 2nd proposition while https://github.com/mozilla/pdf.js/pull/8738 is pending.

1reaction
ChenMachlufcommented, Aug 2, 2017

That little fix solve the problem for me. https://github.com/mozilla/pdf.js/issues/8738 hope it will merge soon

If it not accepted there we can change this to the end of “loadDocument” in pdf.vue

loadingTask
.then(function(pdf) {
	pdfDoc = pdf;
	emitEvent('numPages', pdf.numPages);
	emitEvent('loaded');
})
.catch(function(err) {
	clearCanvas();
	clearAnnotations();
	emitEvent('error', err);
})
.then(function(){
	loadingTask._worker = null;
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Loading PDF Files in React-PDF `Worker was destroyed`
I am trying to create a custom PDF viewer with react-pdf v6.2.0 to load in PDFs that I get from an API that...
Read more >
Explosion that destroyed apartment building caused by worker ...
The worker went to the unit below that apartment and cut what he believed to be a drain waste pipe to remove the...
Read more >
JSDoc: Source: api.js
* Abort all network requests and destroy the worker. * @returns {Promise<void>} A promise that is resolved when destruction is; * completed.
Read more >
PDF.js Destroy Worker Example
PDF.js Destroy Worker Example. GitHub Repo. Create Worker Render PDF Destroy Worker.
Read more >
JSDoc: Source: display/api.js - Index of
disableCreateObjectURL,; verbosity: PDFJS.verbosity; }).then(function (workerId) {; if (worker.destroyed) {; throw new Error('Worker was destroyed');; } ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found