it says the api call inside cannot be taken place like in nextjs build. so just put return above the api call like . (before docker update the env for prodcution)
async function getCaseStudies(): Promise<CaseStudy[]> {
if(process.env.NODE_ENV === "Production"){
return [];
}
const res = await fetch(`${process.env.NEXT_PUBLIC_API_BASE_URL}/api/v1/case-studies/`, {
next: { revalidate: 600 }, // Revalidate every 600 seconds (10 minutes)
});
if (!res.ok) {
// This will activate the closest `error.js` Error Boundary
throw new Error('Failed to fetch case studies');
}
return res.json();
}