thegetty / quire

A multi-package repository for the Quire multiformat publishing framework
https://quire.getty.edu/
BSD 3-Clause "New" or "Revised" License
92 stars 12 forks source link

Missing referenced image files break builds with an unclear error #845

Open cbutcosk opened 12 months ago

cbutcosk commented 12 months ago

Before proceeding, make sure there isn’t an existing issue for this bug.

Expected Behavior

After populating a figures.yaml doc and figure instantiation shortcodes, if any referenced image files are not present I expect quire to either:

Actual Behavior

The build breaks during the epub transform with a somewhat obscure error but quire build acts like the build succeeded after the error message:

  → pdf-epub-copyright/index.html        content/pdf-epub-copyright.md                     31.4kB --
  → pdf-epub-half-title/index.html       content/pdf-epub-half-title.md                    29.5kB --
  → pdf-epub-title/index.html            content/pdf-epub-title.md                         29.7kB --
  • index.html                           content/index.md                                  36.2kB --
[11ty] Problem writing Eleventy templates: (more in DEBUG output)
[11ty] ENOENT: no such file or directory, lstat '_site/_assets/images/figures/EXRR_2023_72_FPO.jpg' (via Error)
[11ty] 
[11ty] Original error stack trace: Error: ENOENT: no such file or directory, lstat '_site/_assets/images/figures/EXRR_2023_72_FPO.jpg'
[11ty]     at Object.lstatSync (node:fs:1668:3)
[11ty]     at Object.lstatSync (/Users/incharge/Projects/org/publication/node_modules/graceful-fs/polyfills.js:318:34)
[11ty]     at statFunc (/Users/incharge/Projects/org/publication/node_modules/fs-extra/lib/util/stat.js:24:20)
[11ty]     at getStatsSync (/Users/incharge/Projects/org/publication/node_modules/fs-extra/lib/util/stat.js:25:19)
[11ty]     at Object.checkPathsSync (/Users/incharge/Projects/org/publication/node_modules/fs-extra/lib/util/stat.js:67:33)
[11ty]     at Object.copySync (/Users/incharge/Projects/org/publication/node_modules/fs-extra/lib/copy/copy-sync.js:27:38)
[11ty]     at AsyncEventEmitter.<anonymous> (/Users/incharge/Projects/org/publication/_plugins/transforms/outputs/epub/index.js:60:10)
[11ty]     at /Users/incharge/Projects/org/publication/node_modules/@11ty/eleventy/src/Util/AsyncEventEmitter.js:19:61
[11ty]     at Array.map (<anonymous>)
[11ty]     at AsyncEventEmitter.emit (/Users/incharge/Projects/org/publication/node_modules/@11ty/eleventy/src/Util/AsyncEventEmitter.js:19:34)
[11ty] Benchmark   1275ms  10%  3730× (Configuration) "slugify" JavaScript Function
[11ty] Benchmark   1197ms  10%    92× (Configuration) "slugifyIds" JavaScript Function
[11ty] Benchmark   2148ms  18%    46× (Configuration) "epub" Transform
[11ty] Benchmark   1476ms  12%    46× (Configuration) "pdf" Transform
[11ty] Benchmark   1715ms  14%    46× (Configuration) "html" Transform
[11ty] Copied 1343 files / Wrote 46 files in 11.39 seconds (247.6ms each, v2.0.1)

Steps to Reproduce

Version Numbers

[publication] quire-cli <=1.0.0.rc-7 quire-11ty 1.0.0-rc.13 starter undefined [System] quire-cli 1.0.0-rc.10 node v18.17.0 npm 6.14.18 os Darwin 22.6.0

Web Browser

na

Relevant Terminal/Shell Output

No response

Supporting Information

No response

Erin-Cecele commented 11 months ago

Thank you for bringing this to our attention, @cbutcosk. We have added this to a collection of improvements we plan to make to how Quire's error messaging is handled. This is currently backlogged but will be addressed. If you have any other suggestions for how our error messages can be improved, please let us know.