Skip to content
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

getRouterParam/getRouterParams are empty in middleware. #715

Closed
sasial-dev opened this issue Nov 30, 2022 · 1 comment
Closed

getRouterParam/getRouterParams are empty in middleware. #715

sasial-dev opened this issue Nov 30, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@sasial-dev
Copy link

Environment

Nitro: 1.0.0
Node.js: 16.16.0

Reproduction

Repo: https://github.com/sasial-dev/nitro-middleware-repro

  1. Run yarn dev
  2. Go to http://localhost:3000/test/param/ (param can be substitued for your choice)
  3. You will see the following:

Brave Browser-n1hq2lHw@2x

Describe the bug

getRouterParam/getRouterParams are empty in middleware.

Additional context

No response

Logs

(from my logging):

PARAM: undefined
PARAMS: {}
@TheAlexLichter TheAlexLichter added the bug Something isn't working label Nov 30, 2022
@pi0
Copy link
Member

pi0 commented May 16, 2024

Middleware runs before the router in the stack. Making it possible requires changing the underlying design of h3 middleware. (PS: route params actually make sense in a matched route not middleware before them)

@pi0 pi0 closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants