App Router Dynamic Routes returning html 404 in Next 14.1.4 with both Edge & Node runtimes (local & vercel) #6260
-
Steps to ReproduceI followed the App Router docs to create a Dynamic Route using /api/test/[id]/route.ts expecting to receive {params: 1234} on dynamic invocation of my handler using /api/test/1234. However, when I call /api/test/1234 I get a 404 html response - but if I call /api/test/[id] I get a 200 indicating that the route is not being handled as a dynamic route but instead is being handled as a static route. Other App Router endpoints are working fine - it's only when using the [id] slug in a dynamic route path that this issue occurs. I can reproduce this locally using next dev & vercel dev and also online in Vercel preview & production (in both Edge and Node runtimes) using Next 14.1.4 and Node 18.8.2. Has anyone else experienced this as I've double-checked everything and this is such a simple use case of App Router dynamic routes?! Thanks, James |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Turns out this issue was caused by rewrites in next.config.mjs |
Beta Was this translation helpful? Give feedback.
-
Hi! I am facing the exact same issue. Were you able to fix it? |
Beta Was this translation helpful? Give feedback.
-
This discussion was automatically locked because the community moved to a new site. Please join us at vercel.community |
Beta Was this translation helpful? Give feedback.
Hi! I am facing the exact same issue. Were you able to fix it?