From b6ffa1689317bd462e08582d64984ddfdbc48cce Mon Sep 17 00:00:00 2001 From: Abe Jellinek <1770299+AbeJellinek@users.noreply.github.com> Date: Mon, 2 Mar 2026 17:46:05 -0500 Subject: [PATCH] Add failsafe to ensure pdf.js build worked --- js-build/reader.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js-build/reader.js b/js-build/reader.js index 6f2b82af4b..12b5df6a92 100644 --- a/js-build/reader.js +++ b/js-build/reader.js @@ -41,6 +41,9 @@ async function getReader(signatures) { } await exec('npm ci', { cwd: modulePath }); await exec('npm run build:zotero', { cwd: modulePath }); + if (!fs.pathExists(path.join(modulePath, 'build', 'zotero', 'pdf', 'build', 'pdf.mjs'))) { + throw new Error('pdf.js build failed to produce output'); + } await fs.copy(path.join(modulePath, 'build', 'zotero'), targetDir); } signatures['reader'] = { hash };