asciidoctor / asciidoctor-pdf

:page_with_curl: Asciidoctor PDF: A native PDF converter for AsciiDoc based on Asciidoctor and Prawn, written entirely in Ruby.
https://docs.asciidoctor.org/pdf-converter/latest/
MIT License
1.14k stars 500 forks source link

Version 2.2.13 of asciidoctor-diagram triggers an errors for wavedrom diagrams when generating PDFs #2450

Closed wmat closed 11 months ago

wmat commented 11 months ago

With the release of version 2.2.13 of asciidoctor-diagram the following error is occurring for wavedrom diagrams when generating PDFs on Linux:

asciidoctor-pdf -r asciidoctor-diagram ./sample.adoc asciidoctor: ERROR: sample.adoc: line 10: Failed to generate image: wavedrom-cli failed: internal/fs/utils.js:581 throw new ERR_INVALID_ARG_TYPE(propName, ['string', 'Buffer', 'URL'], path); ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received type boolean (true) at readFile (fs.js:317:10) at go$readFile (/usr/local/lib/node_modules/wavedrom-cli/node_modules/graceful-fs/graceful-fs.js:118:14) at Object.readFile (/usr/local/lib/node_modules/wavedrom-cli/node_modules/graceful-fs/graceful-fs.js:115:12) at Object.readFile (/usr/local/lib/node_modules/wavedrom-cli/node_modules/universalify/index.js:5:57) at Object. (/usr/local/lib/node_modules/wavedrom-cli/wavedrom-cli.js:36:4) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) { code: 'ERR_INVALID_ARG_TYPE' }

Ref AsciiDoctor-Diagram Issue 441.

mojavelinux commented 11 months ago

This appears to be an issue in Asciidoctor Diagram. Asciidoctor PDF doesn't manage the generation of images in any way. It just reads the files that have already been generated.