Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Path parameter not accessible when using app.onError() #1590

Closed
Labels
@justinwride

Description

@justinwride

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 usingapp.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 file

index.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? usingc.req.param('assignmentId')

What do you see instead?

Instead,c.req.param('assignmentId') isundefined

Additional information

It works ifapp.onError() is put inindex.js, but not if it is used inroutes/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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp