-
Notifications
You must be signed in to change notification settings - Fork 114
Closed
Labels
questionShould probably be a discussionShould probably be a discussion
Description
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:
- Set up a Next.js project using the app/ directory structure.
- Install and configure Keystatic to manage static content (e.g., Markdown files).
- Create a dynamic route, such as app/[slug]/page.tsx, and call the Keystatic reader inside it to fetch content based on the slug.
- Try accessing the route with different dynamic values (/post-1, /post-2, etc.).
- https://nextjs-keystatic-test-params-repro.vercel.app/ (WORKING EXEMPLE)
- https://nextjs-keystatic-test-params-repro.vercel.app/fr (SAME CODE BUT IN app/[locale])
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.
Metadata
Metadata
Assignees
Labels
questionShould probably be a discussionShould probably be a discussion