No description
Find a file
David 6ae4e30284 Invoices: ship pdfjs-dist's worker into the standalone image
Every PDF import failed in production with "Setting up fake worker failed:
Cannot find module '/app/node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs'".

output: "standalone" ships only the files Next's output tracer can see. It
traced pdf.mjs, because lib/invoice-parser.ts imports it by literal path,
but the worker's sole reference is a createRequire(...).resolve() call,
which the tracer does not follow. So the image contained pdf.mjs alone,
pdfjs fell back to its default "./pdf.worker.mjs" relative to pdf.mjs, and
the import hit a file that was never copied.

Copy the whole package in the runner stage: the worker has to sit next to
pdf.mjs, and so do the standard fonts, which the parser needs because it
passes useSystemFonts. Verified against the reconstructed runner layout —
the old layout reproduces the error verbatim, the new one parses and
extracts text.

Also in lib/invoice-parser.ts: workerPinned was set before the resolve, so
a failed resolve was never retried; and the empty catch swallowed the
MODULE_NOT_FOUND that named the real cause. Both fixed.
2026-10-06 10:49:10 +02:00
.mavis/canvas-assets Mega Plant dashboard — fix & harden (Parts 0-5) 2026-09-12 09:35:48 +02:00
app feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
components feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
data/source Invoices: add PHI 169 (Rooihuiskraal) 2026-10-02 06:44:10 +02:00
docs feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
lib Invoices: ship pdfjs-dist's worker into the standalone image 2026-10-06 10:49:10 +02:00
public Brand logo: 3D cube/map icon replaces the M gradient mark 2026-09-12 12:12:30 +02:00
scripts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
worker feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
.dockerignore Round 4: regressions fixed + mobile standard 2026-09-12 12:05:43 +02:00
.env.example Mega Plant dashboard — fix & harden (Parts 0-5) 2026-09-12 09:35:48 +02:00
.gitignore feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
AGENTS.md Invoices: a machine chosen in the dropdown was never actually booked 2026-10-03 15:43:46 +02:00
COOLIFY.md Round 4: regressions fixed + mobile standard 2026-09-12 12:05:43 +02:00
Dockerfile Invoices: ship pdfjs-dist's worker into the standalone image 2026-10-06 10:49:10 +02:00
HANDOFF-PROMPT-2.md Round 2 (Parts B-D): asset register restructure, type field, sequential codes, flat sortable table, cost_lines, removed synthetic code, fail loudly 2026-09-12 10:24:26 +02:00
HANDOFF-PROMPT-3.md Round 3 (Parts A-B): charts fixes + expenses/overheads cleanup 2026-09-12 11:24:18 +02:00
HANDOFF-PROMPT-4.md Round 4: regressions fixed + mobile standard 2026-09-12 12:05:43 +02:00
HANDOFF-PROMPT.md Auto-create synthetic assets for unmatched machines in seed; update open-questions report 2026-09-12 09:40:18 +02:00
next.config.ts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
package-lock.json Sites: give every site coordinates 2026-10-02 16:33:43 +02:00
package.json feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
postcss.config.mjs Mega Plant dashboard — fix & harden (Parts 0-5) 2026-09-12 09:35:48 +02:00
proxy.ts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
tsconfig.json Mega Plant dashboard — fix & harden (Parts 0-5) 2026-09-12 09:35:48 +02:00