nitro icon indicating copy to clipboard operation
nitro copied to clipboard

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

Open noook opened this issue 1 year ago • 0 comments

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

noook avatar Jun 18 '24 20:06 noook