Skip to content

Conversation

@backportbot
Copy link

@backportbot backportbot bot commented Feb 25, 2025

Backport of PR #1159

The "pdfjs-get.js" script downloads and unpacks "pdfjs-dist" in
"js/pdfjs" so it can be loaded from the PDF viewer. However, the PDF.js
version to download was got from "package.json", which just specifies
the desired ranges of versions to use, but not the exact versions
actually being built.

Due to that it could happen, for example after running "npm audit fix",
that "pdfjs-get.js" downloaded version X.Y, as it was the minimum
desired version specified in "package.json", but the dependencies were
resolved and built against version X.Z, as it was the actual version
specified in "package-lock.json".

To solve that now the PDF.js version is got from "package-lock.json"
instead, which provides the exact version to use.

Note, however, that this is just a "safety net" to avoid unexpected
mismatches as a result of running "npm audit fix" or similar; in general
the PDF.js version is expected to be in sync between "package.json" and
"package-lock.json".

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@szaimen szaimen merged commit 190ca6a into stable31 Feb 25, 2025
36 checks passed
@blizzz blizzz mentioned this pull request Mar 4, 2025
3 tasks
@danxuliu danxuliu deleted the backport/1159/stable31 branch May 6, 2025 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants