mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-19 00:12:18 +00:00
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:
1 parent
403cdf8cab
commit
951db4947e
5 files changed
+26
-4
No files matched your search
+1
-1
@@ -36,7 +36,7 @@ try {
|
||||
// v1.4.38.4 → v1.4.42. Do not hand-edit; bump `package.json` and rebuild.
|
||||
const CACHE_VERSION =
|
||||
(typeof self !== "undefined" && self.__APP_VERSION__) ||
|
||||
/* @sw-version-fallback */ "v1.28.0";
|
||||
/* @sw-version-fallback */ "v1.28.1";
|
||||
const STATIC_CACHE = `healthlog-static-${CACHE_VERSION}`;
|
||||
const PAGE_CACHE = `healthlog-pages-${CACHE_VERSION}`;
|
||||
// v1.18.6 — read-only data cache for a curated allowlist of safe GET `/api/*`
|
||||
|
||||
Reference in new issue
Block a user