asciidoctor / asciidoctor-diagram

:left_right_arrow: Asciidoctor diagram extension, with support for AsciiToSVG, BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag), Ditaa, Erd, GraphViz, Mermaid, Msc, PlantUML, Shaape, SvgBob, Syntrax, UMLet, Vega, Vega-Lite and WaveDrom.
http://asciidoctor.org
MIT License
431 stars 106 forks source link

Version 2.2.13 triggers an errors for wavedrom diagrams #441

Closed wmat closed 9 months ago

wmat commented 9 months ago

With the release of version 2.2.13 the following error is occurring for wavedrom diagrams:

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' }

wmat commented 9 months ago

Note that this only seems to occur on Linux.

pepijnve commented 9 months ago

Sorry about that. I'll see if I can reproduce this asap. Pretty sure this is caused by the changes in https://github.com/asciidoctor/asciidoctor-diagram/commit/c0c8c3f1c68cc8aa8676f1778d8f9adc0f9e0d8c#diff-ab2488253f29128584bd1309a0c98459ef7a13471bf4d66e598c5c62e1d50c75R21

pepijnve commented 9 months ago

I'm getting the same error on macOS as well. I had forgotten about the fact the Wavedrom unit tests were disabled in the GitHub Actions test runs which is how I missed the regression. I'm reverting the problematic change and will make a new release shortly to resolve the problem.