MkDocs "contains a link ... not found among documentation files" (strict) in CI
A Markdown page links to another doc that MkDocs cannot resolve to a file. Normally this is a warning; with --strict it becomes a BuildError and fails CI.
What this error means
mkdocs build (with --strict) reports "Doc file 'X.md' contains a link 'Y.md' which is not found in the documentation files" and aborts.
mkdocs
WARNING - Doc file 'guide/index.md' contains a link 'setup.md', but the target
'guide/setup.md' is not found among documentation files.
Aborted with a BuildError!Common causes
The linked page was moved or renamed
The relative link still points to the old path after the target file was renamed or relocated under docs/.
A wrong relative path
The link is relative to the current file; an incorrect prefix or missing directory makes MkDocs unable to resolve it.
How to fix it
Correct the relative link
- Read the source file and target the warning names.
- Fix the link to the real relative path of the target Markdown file.
- Rebuild with --strict to confirm it resolves.
docs/guide/index.md
[Setup guide](../setup.md)Keep links as Markdown file paths
Link to the source .md files (not the built URLs) so MkDocs can validate them at build time.
How to prevent it
- Link to source
.mdfiles using correct relative paths. - Update links whenever you move or rename pages.
- Run
mkdocs build --strictso broken links fail CI.
Related guides
MkDocs "Aborted with a BuildError" in CIFix MkDocs "Aborted with a BuildError!" in CI - a strict build or a plugin raised a fatal error. The specific…
Docusaurus "Docusaurus found broken links" build failure in CIFix "Error: Docusaurus found broken links!" in CI - the production build checks internal links and fails when…
Hugo "REF_NOT_FOUND" ref/relref shortcode error in CIFix Hugo "REF_NOT_FOUND" in CI - a ref or relref shortcode points to a page Hugo cannot find, and refLinksErr…