This code was working perfectly fine yesterday but this morning I am getting this error
pdf.js:276 Uncaught Error: Unknown action from worker: ReaderHeadersReady
at error (pdf.js:276)
at MessageHandler.messageHandlerComObjOnMessage (pdf.js:1565)
at MessageHandler.messageHandlerComObjOnMessage (pdf.js:1565)
pdf.js:276 Uncaught Error: Unknown action from worker: GetReader
at error (pdf.js:276)
at MessageHandler.messageHandlerComObjOnMessage (pdf.js:1565)
Code
function render(file) {
PDFJS.getDocument(file.path).then(function (pdf) {
pdfDoc = pdf;
totalPages = pdf.numPages;
renderPage(pageNumber)
}).catch(function (reason) {
console.error(reason);
});
}
and i am using the worker from
PDFJS.workerSrc = '//mozilla.github.io/pdf.js/build/pdf.worker.js';
The version of pdf.js i am using is 1.7.225 which currently is the lastest stable version.
Does anyone know what is cause this error?
Use specific version of the worker
PDFJS.workerSrc = 'https://npmcdn.com/[email protected]/build/pdf.worker.js';
I had the same issue (but locked at version 1.8.524) and solved it by upgrading to the latest version at the date: 1.8.593
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With