fix(documents): load the local PDF parser lazily so the vault routes stop crashing

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.
This commit is contained in:
Marc-André Bombeck committed 2026-07-09 09:29:35 +02:00
1 parent 403cdf8cab
commit 951db4947e
5 files changed
+26 -4

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
openapi: 3.1.0
info:
title: HealthLog API
version: 1.28.0
version: 1.28.1
description: >-
Self-hosted personal-health-tracking PWA — public API surface for the iOS native client and external ingest.