Skip to content
Latchkey

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.

hugo
ERROR REF_NOT_FOUND: Ref "setup.md": "content/docs/intro.md:14:20": page not found

Common 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

  1. Read the source page and unresolved target the error names.
  2. Correct the ref/relref to the real content path or restore the page.
  3. Rebuild to confirm it resolves.
content/docs/intro.md
[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
# 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.

Frequently asked questions

What causes ""REF_NOT_FOUND""?
The ref/relref target was renamed, moved, or misspelled, so Hugo cannot resolve it to a content page.
How do I fix "REF_NOT_FOUND"?
Fix the ref target

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card