Improve error when writing `mdbook serve` from nested folder
@lquenti is already working on this.
Since Jan 3, 2026.
- Dominant language
- Rust
- Stars
- 22.2k
- Forks
- 1.9k
- PR merge metrics
- PR metrics pending
Description
Problem
My girlfriend and I are using mdbook for our personal cookbook and it works great! She is non-technical, but I CI-automated the deployment so that once she pushes it automatically updates the deployment. The only issue is as follows:
- She opens the folder in kate, starts the embedded terminal
- Tries to
mdbooksomething, with the help ofmdbook --help - Sees
mdbook serve, and gets the following error
klara@zblech:~/Dokumente/data/GitProjekte/rezeptsammlung/src/Klara/Herzhaftes$ mdbook serve
2026-01-03 10:42:02 [ERROR] (mdbook::utils): Error: Couldn't open SUMMARY.md in "/home/klara/Dokumente/data/GitProjekte/rezeptsammlung/src/Klara/Herzhaftes/src" directory
2026-01-03 10:42:02 [ERROR] (mdbook::utils): Caused By: No such file or directory (os error 2)
This is a confusing error message, as if the reader is not experienced with reading error traces, they think
- why does it fail, I can see the SUMMARY.md in my text editor tree (as they are just skimming the path)
- Of course it fails, I don't have this
srcfolder! (As they might not have an understanding how it internally builds the path)
I think this would be easy to improve with a hint
Proposed Solution
on ENOENT error handling (i.e. we are already on the slot path), recursively walk up the path to see whether a parent directory contains a src/SUMMARY.md. If so, print another [INFO] log on whether the user might meant to start it from the parent folder instead.
Notes
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.