Skip to content
Fallow home
All docs pages

Docs home

Dynamic segment conflicts

What a dynamic-segment-name-conflict finding of fallow dead-code means, why it matters and how to fix it.

What it reports

Sibling Next.js dynamic route segments use different slug names at the same position.

Architecture explains how fallow finds it.

Why it matters

Two or more sibling dynamic route segments at the same App Router tree position use different param spellings ([id] vs [slug], or a catch-all [...x] vs an optional catch-all [[...x]]). Next.js throws "You cannot use different slug names for the same dynamic path" at dev and production runtime when the position is hit, because one position must resolve to a single param name. next build does not catch this (the build succeeds), so CI passes while the route crashes on its first request; fallow's static catch closes that gap. Route groups are transparent to the position and parallel slots fork it, so only genuinely-sibling segments conflict. To fix: rename the dynamic segments at the position to one consistent slug name. The check runs only when the project declares next.

Example

app/blog/[id]/page.tsx and app/blog/[slug]/edit/page.tsx use two names for the dynamic segment at the same position.

Fix

Rename the dynamic segments at that position to one name, for example [slug] in both paths.

Facts

FactValue
Issue typedynamic-segment-name-conflict
Rule id in SARIF outputfallow/dynamic-segment-name-conflict
Commandfallow dead-code
Default severityerror
Config key in rulesdynamic-segment-name-conflict
Suppression comment// fallow-ignore-file dynamic-segment-name-conflict
Fixable with fallow fixNo
Opt-inNo
Frameworksnext

When to keep the code

  • The route fails at run time, also when you suppress the finding. Use // fallow-ignore-file dynamic-segment-name-conflict only for a short time.