arkokoley / pdfvuer

A PDF viewer for Vue using Mozilla's PDF.js that supports both Vue2 and Vue3
https://arkokoley.github.io/pdfvuer
MIT License
918 stars 131 forks source link

The API version 2.5.207 does not match the Worker version 2.7.570 #93

Closed oddvernes closed 3 years ago

oddvernes commented 3 years ago

It looks like there is a version mismatch between the pdfjs compiled in pdfvuer.umd.js and the pdfjs that gets installed as a dependency. pdf.worker.js (which is loaded from the dependency) checks the version number in the message (from pdfvuer.umd) and throws an error.

micimize commented 3 years ago

Pinning the pdfjs dist works as a stopgap "pdfjs-dist": "2.5.207",

arkokoley commented 3 years ago

@micimize @oddvernes thank you for mentioning this. I'll pin the pdfjs-dist version going forward.

micimize commented 3 years ago

@arkokoley I guess that would work but I think ideally it would just be vendored

Uraharadono commented 3 years ago

Just installed "pdfvuer": "^1.8.3", and while trying advanced example I get error:

UnknownErrorException {
message: "The API version \"2.5.207\" does not match the Worker version \"2.8.335\".", 
name: "UnknownErrorException", 
details: "Error: The API version \"2.5.207\" does not match the Worker version \"2.8.335\"."
}
details: "Error: The API version \"2.5.207\" does not match the Worker version \"2.8.335\"."
message: "The API version \"2.5.207\" does not match the Worker version \"2.8.335\"."
name: "UnknownErrorException"
__proto__: Error

So I guess this corresponds to what you guys said. What version is not affected by this, so I can downgrade to it?

micimize commented 3 years ago

@Uraharadono I don't think you need to downgrade, try just pinning the dist like I mentioned above

Pinning the pdfjs dist works as a stopgap "pdfjs-dist": "2.5.207",

Uraharadono commented 3 years ago

@micimize Hey Michael, Thanks a lot for your help. I was tired today and I missed totally that I need to install pdfjs-dist, I figured that pdfjsis used internally for build of this library. So, after installing both:

"pdfjs-dist": "2.5.207",
"pdfvuer": "^1.8.3",

It works now. Even with the URL that points to download Action on server. Thanks a million times mate.

arkokoley commented 3 years ago

Thanks to @micimize @oddvernes for bringing this issue to notice. Fixed this as part of v1.9.1