We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
3.8.0
Cloudflare Workers
When using app.onError() within a nested route, the path parameters are not accessible.
app.onError()
c.req.param('assignmentId') does not work when app.onError(err, c) is in the nested route file
c.req.param('assignmentId')
app.onError(err, c)
index.js routes/example.js
See this project for example: https://github.com/justinwride/hono-path
I expect to access the path parameter for the route /assignments/:assignmentId? using c.req.param('assignmentId')
Instead, c.req.param('assignmentId') is undefined
undefined
It works if app.onError() is put in index.js, but not if it is used in routes/example.js.
I have been experimenting with Hono and enjoy the simplicity and speed. I'm the CTO of an ed-tech company and hope to use it more in our tech stack.
The text was updated successfully, but these errors were encountered:
Hi @justinwride Thanks for the report. This appears to be a bug caused by #1566 and will be investigated.
Sorry, something went wrong.
c.req.params()
Hi @justinwride!
Thank you for reporting with the kind explanation.
This issue has been fixed by @usualoma's implementation and the release v3.8.1 includes it. Please give it a try!
Thanks @yusukebe and @usualoma! 💯
The fix was very quick and works perfectly. Hono is awesome!
Successfully merging a pull request may close this issue.
What version of Hono are you using?
3.8.0
What runtime/platform is your app running on?
Cloudflare Workers
What steps can reproduce the bug?
When using
app.onError()
within a nested route, the path parameters are not accessible.c.req.param('assignmentId')
does not work whenapp.onError(err, c)
is in the nested route fileindex.js
routes/example.js
See this project for example: https://github.com/justinwride/hono-path
What is the expected behavior?
I expect to access the path parameter for the route /assignments/:assignmentId? using
c.req.param('assignmentId')
What do you see instead?
Instead,
c.req.param('assignmentId')
isundefined
Additional information
It works if
app.onError()
is put in index.js, but not if it is used in routes/example.js.I have been experimenting with Hono and enjoy the simplicity and speed. I'm the CTO of an ed-tech company and hope to use it more in our tech stack.
The text was updated successfully, but these errors were encountered: