Reader fails in Dynamic Route inside app router root directory on production #1387
Unanswered
bastienrobert
asked this question in
Q&A
Replies: 1 comment
-
I'm not so sure if it is a bug with keystatic or nextjs. If you follow the docs as is right now. The single collection example will be a dynamic route in NextJS. You can do that in Next 14 with export async function generateStaticParams() {
const posts = await reader.collections.posts.all();
return posts.map((post) => ({ slug: post.slug }));
} So maybe this part needs to be updated |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When trying to use the Keystatic reader to fetch content within a dynamic route under the app/ directory, the reader does not function as expected.
This issue occurs specifically when the route is dynamic ([slug], [id], etc.), and the Keystatic reader is called to fetch content dynamically based on the route parameters.
Steps to Reproduce:
REPO
https://github.com/bastienrobert/nextjs-keystatic-test-params-repro
Workaround:
Dynamic import using the standard
import()
method, put every mdx and markdoc inline and format files to JSON.Beta Was this translation helpful? Give feedback.
All reactions