nitro
nitro copied to clipboard
bug: wrong route parameter name matched, but handler is correct
Environment
Nitro: 2.9.6 with Nuxt 3.12.2 Node: v20.14.0
Reproduction
- https://stackblitz.com/edit/github-xnbwjb?file=server%2Froutes%2F%5BprestationId%5D%2Findex.put.ts
- 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