hello , nextjs 14 app with next-intl ->
(main)/[locale]/projects/[projectsSlugName]/page.tsx
(the relevant parts of the page are below),
export async function generateStaticParams() {
const projects = await getAllProjects();
if (!projects) {
return []
}
return projects.map((project)=>{
return {projectSlugName:project.urlPath}
})
}
const Page = async ({ params }: { params: { projectSlugName: string,locale: string } }) => {
unstable_setRequestLocale(params.locale)
console.log("projectSlugName rendered ",params.projectSlugName)
const t = await getTranslations("Constants");
const Project = await getProjectWithLang(params.projectSlugName, params.locale);
if (!Project) {
notFound()
}
When I use generateStaticParams in that route , when page return notFound() in npm run dev mode it shows 404 page , while in production it shows the page as 500:internal server error.
error message below :
Page changed from static to dynamic at runtime /tr/projects/doc-coffee-co-kafe-tasarimia, reason: headers
if i remove the generateStaticParams page returns 404 in both dev mode and production mode as it should be.