Skip to content

Invalid theme causes Rendering failed, but an invalid default-theme does not #3140

Description

@hollow-owl

Problem

Invalid theme causes an error and building the book fails, however an invalid default-theme does not. I would expect that an invalid default-theme would also fail to build.

Steps

  1. In book.toml add
[output.html]
theme = "does-not-exist"
  1. Try to run mdbook serve
  2. As expected it gives an error
$ mdbook serve
 INFO Book building has started
 INFO Running the html backend
ERROR Rendering failed
        Caused by: theme dir /scratch/does-not-exist does not exist
  1. Now, in book.toml change theme to default-theme
[output.html]
default-theme = "does-not-exist"
  1. Run mdbook serve
  2. It succeeds but the css is broken with links looking the same as normal text and a weird header
$ mdbook serve
 INFO Book building has started
 INFO Running the html backend
 INFO HTML book written to `/scratch/book`
 INFO Serving on: http://localhost:3000
 INFO Watching for changes...
Image Image

Possible Solution(s)

Make default-theme fail to build the book like a normal theme does

Notes

No response

Version

mdbook v0.5.3

Metadata

Metadata

Assignees

Labels

C-bugCategory: A bug, incorrect or unintended behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions