mdbook-epub: Markdown images break the plugin invoking errors

For example:

![FXRMotionControllerData Blueprint representation](fxrmotioncontrollerdata-blueprint-representation.png "FXRMotionControllerData Blueprint representation")

Produces:

2024-07-18 14:00:54 [INFO] (mdbook::book): Book building has started
2024-07-18 14:00:55 [INFO] (mdbook::book): Running the epub backend
2024-07-18 14:00:55 [INFO] (mdbook::renderer): Invoking the "epub" renderer
Running mdbook-epub as plugin...
[2024-07-18T12:00:55Z ERROR mdbook_epub::generator] Failed finding/fetch resource taken from content? Look up content for possible error... Caused by: Asset was not found: 'fxrmotioncontrollerdata-blueprint-representation.png' by '/SomeProject/Handbook/src/advanced-topics/openxr/consuming-fxrmotioncontrollerdata/index.md/fxrmotioncontrollerdata-blueprint-representation.png', error = No such file or directory (os error 2)
[2024-07-18T12:00:55Z ERROR mdbook_epub] Asset was not found: 'fxrmotioncontrollerdata-blueprint-representation.png' by '/SomeProject/Handbook/src/advanced-topics/openxr/consuming-fxrmotioncontrollerdata/index.md/fxrmotioncontrollerdata-blueprint-representation.png', error = No such file or directory (os error 2)
2024-07-18 14:00:55 [ERROR] (mdbook::renderer): Renderer exited with non-zero return code.
2024-07-18 14:00:55 [ERROR] (mdbook::utils): Error: Rendering failed
2024-07-18 14:00:55 [ERROR] (mdbook::utils): 	Caused By: The "epub" renderer failed
make: *** [GNUmakefile:282: serve] Error 101

This however works fine with the HTML backend as intended.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

Before a fix landed, downgrade to 0.4.27 to workaround this for now to produce a valid epub for reading.

cargo install --version 0.4.27 mdbook-epub

Look deep into it, something happened when refactoring before. Even build pass, the image is embed to wrong path and not visible when reading ePub file.

This bug is introduced in commit and error only occurs when running as a preprocessor and links preprocessor enabled. The issue, image is not found when reading, is happened whether how the book is built.