Optional vs required catch-all, async params в Next 15, params always strings.
Разбор
- Catch-all vs optional.
[...slug] не матчит base; [[...slug]] матчит. 404 на /docs при working /docs/x — нужны double brackets.
params async в Next 15. Sync destructure — bug; must await params. Frequent migration break.
- Params always strings.
/items/007 → '007'; compare to number silently fails.
- Route conflicts by specificity — static
/shop/new beats dynamic /shop/[id]. Two dynamic siblings same level — error.
notFound() и redirect() — idiomatic escape hatches; throw и unwind, code after never runs.
Итог
Dynamic routing gotchas: [[...slug]], await params, string comparison.