-
Notifications
You must be signed in to change notification settings - Fork 112
Closed
Description
I'm trying Keystatic out for a new project and followed the Next JS tutorial. Not sure if this is a Vercel or Keystatic issue, but the reader doesn't return posts when deployed on Vercel when the page is a dynamic route (eg. [slug].tsx). Static routes work fine. Also everything works well locally.
// app/posts/[slug].tsx
const reader = createReader(process.cwd(), keystaticConfig);
export default async function PostPage(params) {
const post = await reader.collections.posts.read(params.slug);
// post is empty when deployed on Vercel!
// but works fine locally
return ...
}Static page routes work fine:
// app/posts/static-post.tsx
const reader = createReader(process.cwd(), keystaticConfig);
export default async function PostPage() {
const post = await reader.collections.posts.read('static-post')
// No probs, post has data
return ...
}Using:
"@keystatic/core": "^0.3.17"
"@keystatic/next": "^3.0.0"
"next": "14.1.0"I've created a reproduction repo here: https://github.com/unkleho/nextjs-keystatic-test
The deployed site is here: https://nextjs-keystatic-test.vercel.app/
Any help on this would be great. Perhaps I've missed a step?
Thanks heaps for the cool project.
Metadata
Metadata
Assignees
Labels
No labels