Hugo "REF_NOT_FOUND" ref/relref shortcode error in CI
A {{< ref >}} or {{< relref >}} shortcode references a page that Hugo cannot resolve. When refLinksErrorLevel is ERROR, this fails the build instead of emitting a warning placeholder.
What this error means
hugo fails with "REF_NOT_FOUND: Ref "X": page not found" naming the source page and the unresolved target.
ERROR REF_NOT_FOUND: Ref "setup.md": "content/docs/intro.md:14:20": page not foundCommon causes
The referenced page does not exist
The ref/relref target was renamed, moved, or misspelled, so Hugo cannot resolve it to a content page.
A wrong path relative to the page
relref resolves relative to the current page; an incorrect relative path points at no page.
How to fix it
Fix the ref target
- Read the source page and unresolved target the error names.
- Correct the ref/relref to the real content path or restore the page.
- Rebuild to confirm it resolves.
[Setup]({{< relref "setup.md" >}})Confirm the error level is intentional
Keeping refLinksErrorLevel = "ERROR" makes broken refs fail CI; lower it only if you accept warnings.
# hugo.toml
refLinksErrorLevel = "ERROR"How to prevent it
- Use ref/relref with correct content paths.
- Update refs when renaming or moving content.
- Keep
refLinksErrorLevel = "ERROR"so broken refs fail the build.