Diagnostics

LUM5007: Route param named locale

A route param is named locale, which href() reserves with lumiose({ i18n }).

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

Reported by: the route scanner (lumiose check, typegen, dev server), only with lumiose({ i18n }).

#What it means

With lumiose({ i18n }), the router handles the locale prefix of every URL (/es/about), and href(pattern, { locale }) uses the locale key to pick the URL's locale. A [locale] (or [[locale]]) folder would give a route a param with the same name, which href() could not fill.

#Example

text
src/routes/[locale]/about/page.stsx     "/[locale]/about" has a param named "locale"

#How to fix it

Remove the [locale] folder: src/routes/about/page.stsx already serves /about, /es/about and every other locale it declares with export const locales, and locale() reads the request's locale. If the param means something else, rename it ([lang], [region]).