What version of Hono are you using?
4.6.5 4.9.5 (letest at this moment. sorry!)
What runtime/platform is your app running on? (with version if possible)
Cloudflare Workers (issue observed in local type inference only)
What steps can reproduce the bug?
When defining endpoints with method chaining, if a "use()" method is inserted, the routes declared before that "use()" are not included in the inferred type information.
import { Hono } from "hono";
const routerA = new Hono()
.get("/", (c) => c.text("Hello from Router A!"))
.use("/:slug", async (c, next) => {
return next();
})
.post("/:slug", (c) => c.text("Hello from Router A with slug!"));
const app = new Hono().route("/a", routerA);
export type AppType = typeof app;
export default app;
What is the expected behavior?
Chained routes defined before "use()" should still be inferred in the types.
What do you see instead?
No response
Additional information
No response
What version of Hono are you using?
4.6.54.9.5 (letest at this moment. sorry!)What runtime/platform is your app running on? (with version if possible)
Cloudflare Workers (issue observed in local type inference only)
What steps can reproduce the bug?
When defining endpoints with method chaining, if a "use()" method is inserted, the routes declared before that "use()" are not included in the inferred type information.
What is the expected behavior?
Chained routes defined before "use()" should still be inferred in the types.
What do you see instead?
No response
Additional information
No response