Skip to content

fix: interpret mjs as text/javascript#1612

Merged
jekabs-karklins merged 5 commits into
developfrom
SWAP-5650-bug-cant-load-pdf-preview
Jul 3, 2026
Merged

fix: interpret mjs as text/javascript#1612
jekabs-karklins merged 5 commits into
developfrom
SWAP-5650-bug-cant-load-pdf-preview

Conversation

@jekabs-karklins

@jekabs-karklins jekabs-karklins commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Description

The latest PDFjs package uses moduler js extension .mjs. This PR introduces a fix to interpret .mjs files as text/javascript in our Nginx configuration when the docker image is built.

Motivation and Context

The change is required to prevent .mjs files (ES module workers like pdf.worker.min.mjs) from being served as application/octet-stream which was causing them to be rejected by the browser's strict module MIME check.

Changes

  • Updated the base image in the Dockerfile to from nginxinc/nginx-unprivileged:alpine1.25 => nginxinc/nginx-unprivileged:alpine3.23
  • Added a new location block in the Nginx configuration to serve .mjs files as text/javascript.
  • Moved the root directive to the server block level in Nginx configuration.

How Has This Been Tested?

Fixes Jira Issue

https://jira.ess.eu//browse/SWAP-5650

Depends On

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

@jekabs-karklins jekabs-karklins requested a review from a team as a code owner June 30, 2026 08:02
@jekabs-karklins jekabs-karklins requested review from ACLay and removed request for a team June 30, 2026 08:02
@jekabs-karklins jekabs-karklins enabled auto-merge July 3, 2026 08:43
@jekabs-karklins jekabs-karklins merged commit 8609c73 into develop Jul 3, 2026
35 of 36 checks passed
@jekabs-karklins jekabs-karklins deleted the SWAP-5650-bug-cant-load-pdf-preview branch July 3, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants