react-pdf-viewer / starter

Some boilerplates to use React PDF viewer component
https://react-pdf-viewer.dev
25 stars 30 forks source link

The API version "2.16.105" does not match the Worker version "2.15.349". #44

Open dhruvkrstech opened 2 years ago

dhruvkrstech commented 2 years ago

working with react-pdf-viewer library getting this error(The API version "2.16.105" does not match the Worker version "2.15.349".) thus i have directy cloned the git repo from starter folder

this are my following version in my package.json file

"@react-pdf-viewer/core": "3.6.0", "@react-pdf-viewer/default-layout": "3.6.0", "pdfjs-dist": "^2.15.349", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "^4.0.3"

pls let me know and reply within 24 hrs asap Thankyou

Screenshot (297)

ShafiqDevs commented 1 year ago

same issue here. cloned the nextjs example and getting the same error

mikemclin commented 1 year ago

I think it is because you installed using a caret semver range specifier ^2.15.349. This will install the latest version that matches that range (which was 2.16.105 at the time of your install).

Instead you need to install an exact version of the package, so you need to remove the leading caret - 2.15.349 in your package.json. After making the change, reinstall dependencies.