Closed BryanAbate closed 3 months ago
.use
always generate { [x: string]: never }
It may be cause https://github.com/honojs/hono/blob/main/src/types.ts#L1806
generics of .use
was marked at any
createMiddleware
breaks typing
I will try to work on this issue. https://github.com/honojs/hono/blob/main/src/types.ts#L680
This is a common workaround, but I don't think it is what you are looking for.
Thank you for looking into the issue @EdamAme-x !
What version of Hono are you using?
4.4.12
What runtime/platform is your app running on?
Node
What steps can reproduce the bug?
Stackblitz of the reproduction: https://stackblitz.com/edit/hono-client-typing-issue-middleware?file=src%2Fapp.ts
When using
.use
with a path like.use('*', myMiddleware)
hono client typings will break. Removing the path'*'
solves the typing issue.I suppose https://github.com/honojs/hono/pull/3087 introduced the regression.
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response