Skip to content

Add version to pdf.js file in webpack builds

Chaoyue Zhao requested to merge 491716-backport-17.4 into 17-4-stable-ee

What does this MR do and why?

This MR backports the changes from !168419 (merged) to 17-4-stable-ee.

pdf.js was upgraded in 17.4, and we discovered that a cached version of assets/webpack/pdfjs/pdf.worker.min.js can be served, causing PDF rendering issues.

This backport ensures that PDF rendering works as expected for self-managed instances.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

  1. follow the instructions to run the app in webpack
  2. run yarn run clean to remove the existing pubic/assets files
  3. run yarn webpack, new pdfjs files should be copied under public/assets/webpack/pdfjs/3.11.174
  4. viewing pdf files should work as expected

note, i am not 100% sure if there is a way to see the files being copied, besides running yarn webpack, which triggers the copy plugin. the source tab in the browser only shows the public output path. however, webpack only runs in gdk for me withOUT the public assets folder. so after the first 3 steps, the public asset needs to be removed to make sure webpack is working again.

Related to #491716 (closed)

Edited by Chaoyue Zhao

Merge request reports

Loading