You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When chaining after use and not providing a path to get.
newHono().use("/:id",async(c,next)=>{awaitnext();}).get((c)=>{constid=c.req.param("id");returnc.text(id);// TypeScript complains that `id` might be `undefined`.});
When providing a path to get.
newHono().use("/:id",async(c,next)=>{awaitnext();}).get("/:id",(c)=>{constid=c.req.param("id");returnc.text(id);// TypeScript is happy.});
Compare this to chaining after post and not providing a path to get.
newHono().post("/:id",async(c)=>{constid=c.req.param("id");returnc.text(id);}).get((c)=>{constid=c.req.param("id");returnc.text(id);// TypeScript is happy.});
What is the expected behavior?
That path for chained app.HTTP_METHOD calls should be inferred after a app.use call.
What do you see instead?
That path for chained app.HTTP_METHOD calls is not being inferred after a app.use call.
Additional information
No response
The text was updated successfully, but these errors were encountered:
What version of Hono are you using?
4.4.7
What runtime/platform is your app running on?
Node.js
What steps can reproduce the bug?
When chaining after
use
and not providing apath
toget
.When providing a
path
toget
.Compare this to chaining after
post
and not providing apath
toget
.What is the expected behavior?
That
path
for chainedapp.HTTP_METHOD
calls should be inferred after aapp.use
call.What do you see instead?
That
path
for chainedapp.HTTP_METHOD
calls is not being inferred after aapp.use
call.Additional information
No response
The text was updated successfully, but these errors were encountered: