New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
defaultHook not picked up in nested routes #2520
Comments
I'm reopening this issue becasue: I have a
it sets a I created my root app like:
The sub-routes I was initially creating like:
Note that I'm using What this setup means for the pets sub-routes:
Now when using the
E.g. from logs for a single request:
of course I could easily update my |
What version of Hono are you using?
4.2.4
What runtime/platform is your app running on?
Cloudflare Pages Functions
What steps can reproduce the bug?
Create a base app like below with a default hook handling validation errors:
Routes then directly connected to the
app
instance like will correctly use thisdefaultHook
as expected, e.g.:but when nesting routes like:
the book routes will not use the
defautHook
as defined on the baseapp
.What is the expected behavior?
That the
books
routes will also use thedefaultHook
from the baseapp
for handling validation errors.What do you see instead?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: