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

bug: wrong route parameter name matched, but handler is correct #2545

Open
noook opened this issue Jun 18, 2024 · 0 comments
Open

bug: wrong route parameter name matched, but handler is correct #2545

noook opened this issue Jun 18, 2024 · 0 comments

Comments

@noook
Copy link
Contributor

noook commented Jun 18, 2024

Environment

Nitro: 2.9.6 with Nuxt 3.12.2
Node: v20.14.0

Reproduction

  1. https://stackblitz.com/edit/github-xnbwjb?file=server%2Froutes%2F%5BprestationId%5D%2Findex.put.ts
  2. Visit: /plop

Describe the bug

Maybe related to #2349

When having different param names within the same folder:

server/api/prestations
├── [prestationId]
│   ├── index.patch.ts
│   └── order.post.ts
├── [slug].get.ts
└── index.get.ts

[slug].get.ts router param [slug] will be prestationId instead of slug
If I rename the [slug].get.ts to [alug].get.ts (before in alphabetical order) it will have the correct parameter. I haven't tested if in this situation the route [prestationId]/index.patch.ts will now have the wrong parameter names.

Additional context

No response

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant