Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 19, 2026

CI build was failing during page data collection phase with TypeError: Cannot read properties of undefined (reading 'map') in the fumadocs documentation site.

Changes

  • Added generateStaticParams() - Next.js requires this for catch-all routes [[...slug]] to determine which pages to statically generate
  • Added generateMetadata() - Required for metadata generation during build; includes error handling for missing pages
  • Switched to static generation - Changed dynamicParams to false and removed dynamic = 'force-dynamic'
  • Updated Next.js to 15.3.0 - Matches [email protected] peer dependency requirement (was 15.1.6)
  • Added root meta.json - Defines navigation structure for docs at content/docs/meta.json
export function generateStaticParams() {
  return source.generateParams();
}

export async function generateMetadata(props: {
  params: Promise<{ slug?: string[] }>;
}): Promise<Metadata> {
  const params = await props.params;
  const page = source.getPage(params.slug);
  
  if (!page) return {};
  
  return {
    title: page.data.title || 'Documentation',
    description: page.data.description || undefined,
  };
}

Note

Build still fails at same point. Root cause appears to be fumadocs-mdx 14.x / fumadocs-core 15.x compatibility issue or missing async mode configuration. These changes are necessary prerequisites but may not be sufficient.

Original prompt

引用: https://github.com/objectstack-ai/objectos/actions/runs/21140744267/job/60795455667#step:6:1


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

- Add generateStaticParams function to export static params for all doc pages
- Add generateMetadata function to properly generate page metadata
- Change dynamicParams from true to false and remove 'force-dynamic'
- Update Next.js from 15.1.6 to 15.3.0 to match fumadocs-mdx peer dependencies
- Add root meta.json for docs navigation structure
- Add description rendering in page component

These changes address the build error "Failed to collect configuration" by ensuring
Next.js has the required functions for static generation.

Co-authored-by: huangyiirene <[email protected]>
Copilot AI changed the title [WIP] Update action run log for better clarity Add generateStaticParams and generateMetadata to fix Next.js build failure Jan 19, 2026
Copilot AI requested a review from huangyiirene January 19, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants