From 2de3e291797588788a995d76e512795f73b824a3 Mon Sep 17 00:00:00 2001 From: CC Worker Date: Sun, 7 Jun 2026 03:21:44 +0000 Subject: [PATCH] fix: serve .mjs files as application/javascript for pdfjs module worker nginx:alpine mime.types only covers .js, not .mjs. The pdfjs-dist v4 worker is output as pdf.worker-*.mjs; without the correct MIME type the browser refuses to execute it as a module worker and pdfjs throws 'Network Error', blocking the PDF backdrop from rendering. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 0a5c0ba..7f87db7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,9 @@ FROM nginx:alpine # Copy built files COPY --from=builder /app/dist /usr/share/nginx/html +# .mjs files (pdfjs worker) must be served as application/javascript for module workers +RUN sed -i 's|application/javascript\s*js;|application/javascript js mjs;|' /etc/nginx/mime.types + # Create a simple nginx configuration RUN echo 'server { \ listen 3000; \