stephanrauh / ngx-extended-pdf-viewer

A full-blown PDF viewer for Angular 16, 17, and beyond
https://pdfviewer.net
Apache License 2.0
449 stars 167 forks source link

pdf.js: The API version "4.4.566" does not match the Worker version "4.3.657" #2394

Closed tristan-chaumont closed 2 days ago

tristan-chaumont commented 2 days ago

Hi Stephan, I'm using ngx-extended-pdf-viewer version 20.5.0. When trying to open the ngx-extended-pdf-viewer component, I got a pdf.js console error saying The API version "4.4.566" does not match the Worker version "4.3.657.

CleanShot 2024-06-26 at 09 38 44@2x

I was able to produce this error by first opening a page where an instance of the ngx-extended-pdf-viewer component loads immediately, then navigating to another page and opening a dialog with another instance of the ngx-extended-pdf-viewer component created. What's weird is that if I do it the other way around, the error doesn't occur.

Could you help me on this? Thanks!

stephanrauh commented 2 days ago

Bonsoir Tristan,

that sounds like you've activated the "bleeding edge" branch on the second page, but not on the first page. Or something like that. For some reason the second viewer loads the JavaScript files if pdf.js 4.3, and these files, in turn, load the pdf.worker.mjs file version 4.4.

I'm going to close the ticket because I think now you can solve the issue yourself. If not, add a comment below. I'm still listening the this channel.

Best regards, Stephan

tristan-chaumont commented 2 days ago

Yep, that was it, sorry for the waste of time! I should have found that on my own.