No posts show after following the Vercel Contentful example guide #35955
-
Hello, I've followed this guide exactly: https://github.com/vercel/next.js/tree/canary/examples/cms-contentful And no posts show, either on localhost or after deploying to Vercel. I've double-checked environment variables are set just as the guide specifies. Any ideas what I can check? Any help would be much appreciated! Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
A little bit of console logging might help. Place one in export async function getStaticProps({ params, preview = false }) {
const data = await getPostAndMorePosts(params.slug, preview)
const ret = {
props: {
preview,
post: data?.post ?? null,
morePosts: data?.morePosts ?? null,
},
}
console.log('gSP',ret);
return ret;
}
export async function getStaticPaths() {
const allPosts = await getAllPostsWithSlug()
const ret = {
paths: allPosts?.map(({ slug }) => `/posts/${slug}`) ?? [],
fallback: true,
}
console.log("gSPaths", ret);
return ret;
} When running |
Beta Was this translation helpful? Give feedback.
-
Restarting completely from scratch fixed the issue, so marking this answered. |
Beta Was this translation helpful? Give feedback.
Restarting completely from scratch fixed the issue, so marking this answered.