incorrect routing for dynamic api routes when Next.js and Node runtime are used in same repo #7256
Labels
area: frameworks
area: routing-utils
triaged: bug
Issue or PR has been reviewed by a maintainer and work is being tracked
TLDR;
In a Next.js project with 2 dynamic API routes and 2 static API routes:
All of the routes above works except for
/api/download/something_other_than_hello
. A 404 is returned instead.Expected behaviour
Workaround
A afterFiles rewrite has to be created in
next.config.js
to fix the broken route:Example Repo
https://github.com/vercel-support/63439-nextjs-mixed-apis/ deployed at https://63439-nextjs-mixed-apis.vercel-support.app/ (with the above next.config.js so everything works).
Something Interesting
In the deployment output, the route with problem is deployed without the file
.js
extension -/api/download/[id]
while all other API routes end with.js
.The text was updated successfully, but these errors were encountered: