Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reader fails in Dynamic Route inside app router root directory on production #1333

Open
bastienrobert opened this issue Oct 16, 2024 · 0 comments

Comments

@bastienrobert
Copy link

bastienrobert commented Oct 16, 2024

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:

  1. Set up a Next.js project using the app/ directory structure.
  2. Install and configure Keystatic to manage static content (e.g., Markdown files).
  3. Create a dynamic route, such as app/[slug]/page.tsx, and call the Keystatic reader inside it to fetch content based on the slug.
  4. Try accessing the route with different dynamic values (/post-1, /post-2, etc.).

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant