79413253

Date: 2025-02-04 23:08:58
Score: 0.5
Natty:
Report link

What I assume is you are trying to pass the getFeaturedPosts to the component FeaturedPosts, the issues lies here:

export async function getStaticProps() {
  console.log("getStaticProps called"); 
  const featuredPosts = getFeaturedPosts();
  console.log("Featured posts in getStaticProps:", featuredPosts); // Debugging line

  return {
    props: {
      posts: featuredPosts,
    },
    revalidate: 1800,
  };
}

pass the function to the component instead

 <FeaturedPosts posts={featuredPosts} />

the other issue could be related to folder structure it should be like app/posts/page.tsx

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Starts with a question (0.5): What I as
  • Low reputation (1):
Posted by: Laeeqthedev