404 page not showing
Unanswered
Devon Rex posted this in #help-forum
Devon RexOP
Hello,
I have a weird thing happening on my nextjs app (version 14.2.4).
I have this directory structure
the [partnerTheme]/page.tsx got
Locally, it is correctly throwing a 404 page if the param does not exists, however, it does show the page without data on vercel.
Any idea?
Regards
I have a weird thing happening on my nextjs app (version 14.2.4).
I have this directory structure
/app
[lng]/
layout.tsx
(group1)/
page.tsx
layout.tsx
[partner]/
page.tsx
layout.tsxthe [partnerTheme]/page.tsx got
export const dynamicParams = false; and the following functionexport const dynamicParams = false;
export async function generateStaticParams() {
const partner = await getPartner();
let customPath = [
...partner.data.map((d) => ({ partner: d.uid })),
];
return customPath;
}Locally, it is correctly throwing a 404 page if the param does not exists, however, it does show the page without data on vercel.
Any idea?
Regards
6 Replies
Barbary Lion
Can you debug the return of getPartner on Vercel? Maybe it is unable to fetch the partner at build time?
Just add a log inside the getPartner function and look in the build logs at what is returned.
Just add a log inside the getPartner function and look in the build logs at what is returned.
@Barbary Lion Can you debug the return of getPartner on Vercel? Maybe it is unable to fetch the partner at build time?
Just add a log inside the getPartner function and look in the build logs at what is returned.
Devon RexOP
seems that I can, here's the build log
customPath [
{ partner: 'abcd' },
{ partner: 'def' },
]added the log there
export async function generateStaticParams() {
const partner = await getPartner();
let customPath = [
{ partner: 'abcd' },
...partner.data.map((d) => ({ partner: d.uid })),
];
console.log('customPath', customPath);
return customPath;
}because [partner] is under the [lng] directory, shall I add lng as well into the mapping?
Devon RexOP
any ideas?
Barbary Lion
Can you create a sandbox?