Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions apps/site/app/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
import { source } from '@/lib/source';
import { notFound } from 'next/navigation';
import type { Metadata } from 'next';

export const dynamicParams = true;
export const dynamic = 'force-dynamic';
export const dynamicParams = false;

export function generateStaticParams() {
return source.generateParams();
}

export async function generateMetadata(props: {
params: Promise<{ slug?: string[] }>;
}): Promise<Metadata> {
try {
const params = await props.params;
const page = source.getPage(params.slug);

if (!page) {
return {};
Comment on lines +18 to +19
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is inconsistent error handling between generateMetadata and the Page component. In generateMetadata (line 18-19), when a page is not found, an empty metadata object is returned. However, in the Page component (line 37), the same condition triggers a notFound() call which returns a 404. This inconsistency means pages will be generated with empty metadata even though they don't exist. Consider calling notFound() in generateMetadata when page is null to maintain consistency.

Copilot uses AI. Check for mistakes.
}

return {
title: page.data.title || 'Documentation',
description: page.data.description || undefined,
};
} catch (error) {
console.error('Error in generateMetadata:', error);
return {};
Comment on lines +26 to +28
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error handling in generateMetadata silently swallows all errors by logging to console and returning an empty metadata object. This could hide important issues during the build process. Consider removing the try-catch wrapper since Next.js will handle errors appropriately during static generation, or at minimum, re-throw the error after logging it so the build fails with a clear error message.

Copilot uses AI. Check for mistakes.
}
}

export default async function Page(props: {
params: Promise<{ slug?: string[] }>;
Expand All @@ -16,6 +41,9 @@ export default async function Page(props: {
return (
<div className="container mx-auto px-4 py-8 max-w-4xl">
<h1 className="text-3xl font-bold mb-4">{page.data.title || 'Untitled'}</h1>
{page.data.description && (
<p className="text-lg text-gray-600 mb-6">{page.data.description}</p>
)}
<div className="prose prose-gray max-w-none">
{MDX && <MDX />}
</div>
Expand Down
8 changes: 8 additions & 0 deletions apps/site/content/docs/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"title": "Documentation",
"pages": [
"index",
"guide",
"spec"
]
}
2 changes: 1 addition & 1 deletion apps/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"fumadocs-mdx": "^14.2.5",
"fumadocs-ui": "^15.0.0",
"lucide-react": "^0.344.0",
"next": "^15.1.6",
"next": "^15.3.0",
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Next.js version specifier change from ^15.1.6 to ^15.3.0 allows the package manager to install version 15.5.9 (as shown in pnpm-lock.yaml line 86). While this may work, there's a risk of compatibility issues with the [email protected] package. The PR description mentions fumadocs-mdx requires Next.js 15.3.0 as a peer dependency, but the actual resolved version is 15.5.9. Consider pinning to a more specific version range (e.g., "^15.3.0 <15.4.0") or testing with the exact peer dependency version to ensure compatibility.

Suggested change
"next": "^15.3.0",
"next": "15.3.0",

Copilot uses AI. Check for mistakes.
"react": "^18.3.1",
"react-dom": "^18.3.1",
"zod": "^4.3.5"
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading