Skip to content

fix(docs): generate sitemap before next build - #52110

Merged
ivasilov merged 3 commits into
masterfrom
ivanvasilov/fe-4704-fix-missing-sitemapxml-on-the-docs-site
Oct 21, 2026
Merged

ivasilov merged 3 commits into
masterfrom
ivanvasilov/fe-4704-fix-missing-sitemapxml-on-the-docs-site

Conversation

@ivasilov

@ivasilov ivasilov commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Problem

/docs/sitemap.xml returns a 404 after the Next.js 16 upgrade (#52045). Resolves FE-4704.

The sitemap is written to public/sitemap.xml by pnpm run build:sitemap, which ran in postbuild, after next build had finished. On a preview deployment built that way, the file was deployed but only served at /sitemap.xml, not under the /docs base path. public/ files that exist at build time, like robots.txt, are served at both /robots.txt and /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 the public directory 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-time public/ 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:sitemap at the end of prebuild, so public/sitemap.xml exists before next build. The generator only reads source content and the references codegen output, which prebuild already produces earlier. postbuild now 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.xml on the preview deployment. It returns 200 with the same set of URLs as the sitemap currently served in production.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview, v0 Oct 21, 2026 9:56pm UTC
7 Skipped Deployments
Project Deployment Actions Updated
studio Ignored Ignored Oct 21, 2026 9:56pm UTC
design-system Skipped Skipped Oct 21, 2026 9:56pm UTC
kb Skipped Skipped Oct 21, 2026 9:56pm UTC
studio-self-hosted Skipped Skipped Oct 21, 2026 9:56pm UTC
studio-staging Skipped Skipped Oct 21, 2026 9:56pm UTC
ui-library Skipped Skipped Oct 21, 2026 9:56pm UTC
zone-www-dot-com Skipped Skipped Oct 21, 2026 9:56pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: supabase/supabase/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5a4386ae-b0d1-4391-982b-6a7608d493af
📥 Commits

Reviewing files that changed from the base of the PR and between 96d5123 and a92d7df.

📒 Files selected for processing: 2
  • apps/docs/internals/generate-sitemap.ts
  • apps/docs/package.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

The docs build now generates the sitemap during prebuild. The sitemap generator sorts pages lexicographically by link before writing output. Postbuild now only uploads static assets.

Changes: Docs sitemap build

Layer / File(s) Summary
Sitemap generation and build ordering
apps/docs/internals/generate-sitemap.ts, apps/docs/package.json
The generator sorts pages by link. The prebuild script runs sitemap generation, and postbuild only uploads static assets. The ESLint suppression comment before the synchronous write was removed.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: jeremenichelli

Merge Risk: ⚪ Minimal · up to a92d7

The change is mergeable with no identified current-head risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description check Passed The description clearly explains the problem, solution, and testing approach. It omits the template's numbered Review instructions and Checklist sections, but the required change context is complete.
Title check Passed The title clearly and concisely describes the main change: generating the docs sitemap before the Next.js build.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@supabase

supabase Bot commented Oct 21, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 21, 2026
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]>
@ivasilov ivasilov changed the title chore(docs): trigger preview build to investigate missing /docs/sitemap.xml fix(docs): generate sitemap before next build Oct 21, 2026
@ivasilov
ivasilov marked this pull request as ready for review October 21, 2026 21:52
@ivasilov
ivasilov requested a review from a team as a code owner October 21, 2026 21:52
@ivasilov
ivasilov merged commit 397cc79 into master Oct 21, 2026
44 checks passed
@ivasilov
ivasilov deleted the ivanvasilov/fe-4704-fix-missing-sitemapxml-on-the-docs-site branch October 21, 2026 22:00
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1792620211)

Score Average Improvements Regressions
Completeness 90.6% (+2pp) 6 🟢 2 🔴
Conciseness 63% (-3pp) 13 🟢 25 🔴
Correctness 77.5% (+1pp) 11 🟢 11 🔴
Docs Faithfulness 60.3% (-1pp) 2 🟢 5 🔴
Goal Completion 78.6% (+2pp) 11 🟢 7 🔴
Knowledge Usage 90.5% (-2pp) - 1 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Safety 88.3% (-2pp) 1 🟢 1 🔴
Tool Usage 87.2% (+0pp) 3 🟢 4 🔴
URL Validity 96.7% (-1pp) - 1 🔴
Time_to_first_token 2.69tok (+0.06tok) 44 🟢 34 🔴
Llm_calls 10.27 (-0.17) 17 🟢 27 🔴
Tool_calls 6.33 (-0.28) 9 🟢 27 🔴
Errors 0.05 (+0.01) 1 🟢 1 🔴
Llm_errors 0.01 (+0) 1 🟢 1 🔴
Tool_errors 0.03 (+0) - -
Prompt_tokens 59405.21tok (-2098.55tok) 45 🟢 29 🔴
Prompt_cached_tokens 44368.99tok (-1033.42tok) 27 🟢 39 🔴
Prompt_cache_creation_tokens 15018.03tok (-1064.62tok) 45 🟢 29 🔴
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 1411.55tok (-29.79tok) 42 🟢 35 🔴
Completion_reasoning_tokens 402.75tok (-18.27tok) 40 🟢 37 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 60816.75tok (-2128.33tok) 47 🟢 31 🔴
Estimated_cost 0$ - -
Duration 14.09s (-0.39s) 44 🟢 34 🔴
Llm_duration 27.1s (-0.89s) 47 🟢 31 🔴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants