Next.js Discord

Discord Forum

Quick blank page while navigating to a different page

Unanswered
Tan posted this in #help-forum
Open in Discord
TanOP
Hi I was fetching dynamic data to generate metadata for my pages. When I fetch metadata dynamically I see quick blank page. Skeleton loads first then a quick blank page and then the original page appears. I am using fetch to get the data. When I don't use fetch in metadata it doesnt affect tho. Could we solve this ?
Here is a code snippet :

export async function generateMetadata({ params }: any) {
  const res = await getJobBySlug(params.slug);
  const job = res?.data?.[0]?.attributes;

  return {
    title: job?.Title,
    description: job?.metadescription,
    keywords: [job?.Type, job?.Experience_Required, job?.Location].filter(
      Boolean,
    ),
  
  };
}

2 Replies

Singapura
Hay @Tan did you find any solution?
@Singapura Hay <@550218535104937996> did you find any solution?
TanOP
No its still there. I couldn't get any solution.