Diagnostics

LUM5003: Duplicate route

Two route files produce the same URL pattern.

Severity: error · Category: routing and server (5xxx)

Reported by: the route scanner (lumiose check, typegen, dev server).

#What it means

Each URL must come from one file. Groups add no segment, a folder holds a page or an endpoint, and an optional segment also serves the URL without it, so different files can collide.

#Example

text
src/routes/blog/page.stsx
src/routes/blog/route.ts                   both are /blog
src/routes/(shop)/cart/page.stsx
src/routes/cart/page.stsx                  both are /cart
src/routes/docs/page.stsx
src/routes/docs/[[...path]]/page.stsx      both serve /docs

#How to fix it

Delete or move one of the files. Param names do not distinguish routes: [id]/page.stsx and [slug]/page.stsx in the same folder also collide. For an optional segment, drop the page that duplicates it (docs/[[...path]] already renders /docs), or use [...path], which needs at least one segment.