Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 20, 2026

The /docs page returned 404 due to incorrect fumadocs-mdx loader integration.

Changes

  • apps/site/lib/source.ts: Fixed source initialization by calling createMDXSource(docs, meta).files() to extract the file array before passing to loader

The fumadocs loader expects source: { files: [...] } (array), but createMDXSource() returns { files: () => [...] } (function). Previous code either passed the function directly or manually mapped the docs array, both failing to match the expected interface.

// Before: Manual mapping that didn't work
const mappedDocs = docs.filter(...).map(...);
export const source = loader({ source: { files: mappedDocs } });

// After: Use the official API
const mdxSource = createMDXSource(docs, meta);
export const source = loader({ source: { files: mdxSource.files() } });

Result

All documentation routes now render correctly with sidebar navigation and table of contents.

docs-page-working

Original prompt

/docs 页面 404


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link

vercel bot commented Jan 20, 2026

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

Project Deployment Review Updated (UTC)
objectui-docs Error Error Jan 20, 2026 4:23am
objectui-site Error Error Jan 20, 2026 4:23am

Request Review

@vercel vercel bot temporarily deployed to Preview – objectui-docs January 20, 2026 04:15 Inactive
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
@vercel vercel bot temporarily deployed to Preview – objectui-docs January 20, 2026 04:23 Inactive
Copilot AI changed the title [WIP] Fix 404 error on /docs page Fix /docs page 404 by calling createMDXSource().files() Jan 20, 2026
Copilot AI requested a review from huangyiirene January 20, 2026 04:25
@github-actions github-actions bot added the apps label Jan 20, 2026
@github-actions
Copy link

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

@huangyiirene huangyiirene marked this pull request as ready for review January 20, 2026 04:52
@huangyiirene huangyiirene merged commit 64cd0a8 into main Jan 20, 2026
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants