Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
7 Skipped Deployments
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Next.js 16 only serves public files that exist at build time, so the sitemap written in postbuild was missing under /docs. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Braintrust eval report
|
Problem
/docs/sitemap.xmlreturns a 404 after the Next.js 16 upgrade (#52045). Resolves FE-4704.The sitemap is written to
public/sitemap.xmlbypnpm run build:sitemap, which ran inpostbuild, afternext buildhad finished. On a preview deployment built that way, the file was deployed but only served at/sitemap.xml, not under the/docsbase path.public/files that exist at build time, likerobots.txt, are served at both/robots.txtand/docs/robots.txt.The Next.js docs say only files in
public/at build time are served (static assets, v14: "Only assets that are in thepublicdirectory at build time will be served by Next.js"). The current docs no longer include that note, and nothing I found says Next.js 16 changed this behavior. The likely cause is that Vercel maps build-timepublic/files under the base path, while files added afterward are only served as plain static files at the root. I couldn't confirm this, or why it worked before the Next.js 16 upgrade.Solution
Run
build:sitemapat the end ofprebuild, sopublic/sitemap.xmlexists beforenext build. The generator only reads source content and the references codegen output, whichprebuildalready produces earlier.postbuildnow only runs the static assets upload.The generator also sorts entries by link, so the sitemap order is stable across builds.
How to test
Check
/docs/sitemap.xmlon the preview deployment. It returns 200 with the same set of URLs as the sitemap currently served in production.🤖 Generated with Claude Code