Dynamic Routes don't Match Sub-Routes when the Parameter Value Contains Hyphens
tpjnorton opened this issue ยท 6 comments
Describe the bug
Basically, when we're using an API route at something like pages/api/posts/[slug]/meta
:
If the value of slug
contains hyphens, e.g. my-first-post
, then any sub-routes (like meta
in this case) no longer match
To Reproduce
Steps to reproduce the behavior:
- Create an API route at
pages/api/posts/[slug]/meta
with a simple GET handler. - Try sending a request when the value of
slug
is 'help-me' - You get "Cannot GET /api/lessons/help-me/meta"
- Note: if you change this to
helpme
, the route matches.
Expected behavior
A route should match.
Hi @tn12787
Thanks for the bug report! Just released a fix in the beta
channel.
Let me know the outcome.
Thanks so much! I'll give it a go and report back :)
๐ This issue has been resolved in version 1.7.2-beta.2 ๐
The release is available on:
Your semantic-release bot ๐ฆ๐
Looks fixed! Think we can close this :)
Thanks for the speedy fix!
๐ This issue has been resolved in version 1.7.3 ๐
The release is available on:
Your semantic-release bot ๐ฆ๐