🐛 Bug Description
When processing PDFs with images, the OpenJPEG WASM module fails to initialize due to a missing fallback file (named 'nullopenjpeg_nowasm_fallback.js'), causing image decode failures across all pages.
📋 Steps to Reproduce
- Install pdf-reader-mcp via npx or npm
- Attempt to process a PDF containing images
- Observe the OpenJPEG errors in the logs
✅ Expected Behavior
Images within PDFs should decode correctly or gracefully fall back to non-WASM/Javascript implementation.
❌ Actual Behavior
Images fail to decode with "JpxError: OpenJPEG failed to initialize" error.
📸 Screenshots / Logs
Apr 09 14:17:59 lyra npx[120832]: Warning: Bad value, for custom key "AAPL:Keywords", in Info: .
Apr 09 14:17:59 lyra npx[120832]: Warning: UnknownErrorException: Ensure that the `standardFontDataUrl` API parameter is provided.
Apr 09 14:17:59 lyra npx[120832]: Warning: JpxImage#instantiateWasm: UnknownErrorException: Ensure that the `wasmUrl` API parameter is provided.
Apr 09 14:17:59 lyra npx[120832]: Warning: JpxImage#getJsModule: Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'nullopenjpeg_nowasm_fallback.js' imported from /home/ami/.npm/_npx/673e420c0bc15d5b/node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs
Apr 09 14:17:59 lyra npx[120832]: Warning: Unable to decode image "img_p1_1": "JpxError: OpenJPEG failed to initialize".
Apr 09 14:18:00 lyra npx[120832]: Warning: Unable to decode image "img_p13_1": "JpxError: OpenJPEG failed to initialize".
Apr 09 14:18:10 lyra npx[120832]: Warning: Bad value, for custom key "AAPL:Keywords", in Info: .
Apr 09 14:18:10 lyra npx[120832]: Warning: UnknownErrorException: Ensure that the `standardFontDataUrl` API parameter is provided.
🖥️ Environment
Package Information:
- Package name: @sylphx/pdf-reader-mcp
- Package version: 2.3.0
- Installation method: npx
System Information:
- OS: NixOS 25.11 (Xantusia)
- Node.js version: v22.21.1
- npm version: 10.9.4
Additional Context:
- MCP Client: n/a (used as MCP server)
🔄 Reproducibility
🔍 Additional Context
The issue appears to be with pdfjs-dist not properly resolving the OpenJPEG WASM module path. The file path 'nullopenjpeg_nowasm_fallback.js' suggests a null prefix being incorrectly prepended to the filename.
🐛 Bug Description
When processing PDFs with images, the OpenJPEG WASM module fails to initialize due to a missing fallback file (named 'nullopenjpeg_nowasm_fallback.js'), causing image decode failures across all pages.
📋 Steps to Reproduce
✅ Expected Behavior
Images within PDFs should decode correctly or gracefully fall back to non-WASM/Javascript implementation.
❌ Actual Behavior
Images fail to decode with "JpxError: OpenJPEG failed to initialize" error.
📸 Screenshots / Logs
🖥️ Environment
Package Information:
System Information:
Additional Context:
🔄 Reproducibility
🔍 Additional Context
The issue appears to be with pdfjs-dist not properly resolving the OpenJPEG WASM module path. The file path 'nullopenjpeg_nowasm_fallback.js' suggests a null prefix being incorrectly prepended to the filename.