mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
The local content-extraction reader imported pdf-parse at module top level. pdf-parse pulls in pdfjs, whose module evaluation references the browser-only DOMMatrix global; on the server that reference throws during chunk instantiation and takes down every route sharing the chunk — the document list, upload, and search among them, so old and new documents alike fail to load. Move the parser to a lazy import() inside the extraction function (surface type kept as a type-only import). Verified under plain Node that the lazy path still extracts a real PDF text layer, so local indexing is unaffected.