diff --git a/src/app/faculty/[id]/page.tsx b/src/app/faculty/[id]/page.tsx
index 27f618b..5228746 100644
--- a/src/app/faculty/[id]/page.tsx
+++ b/src/app/faculty/[id]/page.tsx
@@ -6,8 +6,9 @@ import { notFound } from 'next/navigation';
import { FacultyService } from '../../../lib/facultyData';
import type { Metadata } from 'next';
-// Force dynamic rendering
+// Force dynamic rendering - skip static generation entirely
export const dynamic = 'force-dynamic';
+export const dynamicParams = true;
export default async function FacultyPage({
params,
@@ -21,22 +22,27 @@ export default async function FacultyPage({
notFound();
}
- const memberData = await FacultyService.getFacultyById(memberId);
+ try {
+ const memberData = await FacultyService.getFacultyById(memberId);
- if (!memberData) {
+ if (!memberData) {
+ notFound();
+ }
+
+ return (
+ <>
+
+
+
+ >
+ );
+ } catch (error) {
+ console.error('Error loading faculty member:', error);
notFound();
}
-
- return (
- <>
-
-
-
- >
- );
}
-// REMOVE generateStaticParams entirely
+// REMOVE generateStaticParams completely - don't include it at all
// Generate metadata
export async function generateMetadata({
@@ -60,11 +66,11 @@ export async function generateMetadata({
return {
title: `${memberData.name} - ${memberData.designation} | CMC Vellore`,
- description: memberData.description,
+ description: memberData.description || `${memberData.name} faculty profile at CMC Vellore`,
openGraph: {
title: `${memberData.name} - ${memberData.designation}`,
- description: memberData.description,
- images: [memberData.image],
+ description: memberData.description || `${memberData.name} faculty profile`,
+ images: memberData.image ? [memberData.image] : [],
},
};
} catch (error) {