next.js
6f61fb40 - bugfix: route interception with dynamic paths (#51526)

Commit
2 years ago
bugfix: route interception with dynamic paths (#51526) ### What? Paths with interception markers adjacent to dynamic segments are not correctly parsed, which leads to the path match logic failing. ### Why? `getParametrizedRoutes` checks for brackets but isn't expecting to receive an interception marker. For example, a path of `/photos/(.)[author]/[id]` results in the following regex: `/^\/photos\/\(\.\)\[author\]\/([^/]+?)(?:\/)?$/` This will not match a path of `/photos/(.)zack/1` since it retained the `[author]` brackets. `getSegmentParam` has a similar issue when getting values for path params, though we can just skip the interception markers and go straight to the params. Closes NEXT-1166, NEXT-1013 Fixes #48143 Fixes #49614 link NEXT-1013
Author
Parents
Loading