quire icon indicating copy to clipboard operation
quire copied to clipboard

Missing referenced image files break builds with an unclear error

Open cbutcosk opened this issue 1 year ago • 1 comments

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

  • [X] I have searched the existing issues and determined this is a new 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:

  • Break immediately and alert me about the missing file. Mostly I'd expect automated dev tooling to work this way though!
  • Build anyway and warn me about the missing file. This seems to be the most quire-ish approach, similar to how a reference to a missing figure works now.

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

  • Populate a syntactful figures.yaml but with missing image files
  • Put a figure shortcode referencing a missing image into any content document
  • Run quire build or quire preview

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

cbutcosk avatar Sep 12 '23 13:09 cbutcosk

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.

Erin-Cecele avatar Sep 21 '23 23:09 Erin-Cecele