-
Reader works during the first build process, but when doing ISR, the reader becomes empty. I'm just curious, what causes this to happen? Here is the code I use on getStaticProps: const getAllPost = async () => {
const postSlugs = await reader.collections.posts.list();
console.log("postSlugs", postSlugs);
const data = await Promise.all(
postSlugs.map(async (slug) => {
const post = await reader.collections.posts.read(slug);
const content = (await post?.content()) || [];
return {
...post,
content: content,
slug,
};
}),
);
return data;
}; During the build process in Vercel: Log function when ISR in Vercel: Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
After deploying your app on Vercel, the functions won't have access to the file system where Keystatic stores your content. When all your content is managed by Keystatic you probably don't need ISR. Rather redeploy your site on content changes, which are basically new commits to your repo since they are file changes. When you want to add dynamic data to your pages, consider middleware or client side data fetching. I hope this helps 😄 |
Beta Was this translation helpful? Give feedback.
After deploying your app on Vercel, the functions won't have access to the file system where Keystatic stores your content. When all your content is managed by Keystatic you probably don't need ISR. Rather redeploy your site on content changes, which are basically new commits to your repo since they are file changes.
When you want to add dynamic data to your pages, consider middleware or client side data fetching.
I hope this helps 😄