Open ThangHuuVu opened 8 months ago
Same here, it looks very severe, and so many issues are related. Is there any hacking or workaround ?
Any updates on this?
Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks!
It seems like the basePath is included in the middleware's request. I ended up forwarding it to my route handlers
Link to the code that reproduces this issue
https://github.com/ThangHuuVu/reproduction-app-base-path-route-handler https://reproduction-app-base-path-route-handler.vercel.app/custom
To Reproduce
pnpm i
pnpm dev
Current vs. Expected behavior
Current: The
req.url
is returned as "http://localhost:3000/hello" Expected: It should return "http://localhost:3000/custom/hello"Provide environment information
Which area(s) are affected? (Select all that apply)
App Router, Middleware / Edge (API routes, runtime)
Which stage(s) are affected? (Select all that apply)
next dev (local), Vercel (Deployed), Other (Deployed)
Additional context
Seems that this is the behavior of pages router too. When I add a
pages/api/hello2
API route, it also returns the URL without thebasePath
.