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

MDX integration will not work with dynamic route import #77456

Open
CNLHC opened this issue Mar 24, 2025 · 0 comments
Open

MDX integration will not work with dynamic route import #77456

CNLHC opened this issue Mar 24, 2025 · 0 comments
Labels
Dynamic Routes Related to dynamic routes.

Comments

@CNLHC
Copy link
Contributor

CNLHC commented Mar 24, 2025

Link to the code that reproduces this issue

https://github.com/CNLHC/next-mdx-dynamic-route-reproduce.git

To Reproduce

  1. git clone https://github.com/CNLHC/next-mdx-dynamic-route-reproduce.git
  2. pnpm i
  3. pnpm next
  4. access http://localhost:3000/content/test

Current vs. Expected behavior

Current this process will cause Module Not Found Error

Image

Expected behavior is render markdown file properly.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:23 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6031
  Available memory (MB): 131072
  Available CPU cores: 16
Binaries:
  Node: 23.1.0
  npm: 10.9.0
  Yarn: 1.22.17
  pnpm: 10.6.2
Relevant Packages:
  next: 15.2.3 // Latest available version is detected (15.2.3).
  eslint-config-next: N/A
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.8.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Dynamic Routes

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

This issue is similar to the #51324

Since import will work if we use static string instead of variable.

@github-actions github-actions bot added the Dynamic Routes Related to dynamic routes. label Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dynamic Routes Related to dynamic routes.
Projects
None yet
Development

No branches or pull requests

1 participant