Fix Vercel XML Rendering for Hugo
Deployed a Hugo blog to Vercel, but the site only showed index.xml content.

The Problem
The deployment log was full of warnings, no errors:
18:17:06.313 Installing Hugo version 0.58.2
18:17:24.069 Building sites …
WARN 2025/12/16 10:17:24 found no layout file for "HTML" for "home"
WARN 2025/12/16 10:17:24 found no layout file for "HTML" for "section"
WARN 2025/12/16 10:17:24 found no layout file for "HTML" for "page"
Build stats showed:
Pages | 6
Paginator pages | 0
Non-page files | 0
Static files | 2
Processed images | 0
Aliases | 0
Sitemaps | 1
Cleaned | 0
Total in 12 ms
Only 2 static files, and the build finished in 12 milliseconds with a bunch of missing layout warnings. It basically didn’t build properly, so the site only served the RSS feed.
Root Cause
The key line in the log:
18:17:06.313 Installing Hugo version 0.58.2
Vercel defaults to Hugo 0.58.2, while my local version was 0.152.2.
Solution
Specify the Hugo version explicitly in vercel.json at the project root1:
{
"build": {
"env": {
"HUGO_VERSION": "0.152.2"
}
}
}
After redeploying, the log will show the correct version and the pages will render normally.