Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with only catch-all routing #397

Open
shahnhogan opened this issue Jul 26, 2023 · 0 comments
Open

Issue with only catch-all routing #397

shahnhogan opened this issue Jul 26, 2023 · 0 comments

Comments

@shahnhogan
Copy link
Sponsor Contributor

shahnhogan commented Jul 26, 2023

I'm working on a site that needs the first segment of the path to be a language such as /en-gb, /es, /fr-ca, etc. When visiting these pages you get pages translated to the language in the URL. If the URL doesn't start with a supported language then we default to English. My issue is to support this I believe the entire site needs to be configured as catch-all routing. This would require two file-based routes Route.Index and Route.SPLAT_ according to the documentation. However, when I removed the Route folder and used npx elm-pages@latest run Addroute Index and another for SPLAT_ I get the following error when running npm run start. I'm on elm-pages 3.0.9 according to npx elm-pages --version.

-- REDUNDANT PATTERN --------------- /Users/shahnhogan/explorations/elm-pages-slugger/elm-stuff/elm-pages/.elm-pages/Route.elm
The 3rd pattern is redundant:

24|     case segments of
25|     [] ->
26|         Just Index
27| 
28|     splatFirst :: splatRest ->
29|         Just (SPLAT_ { splat = ( splatFirst, splatRest ) })
30| 
31|>    _ ->
32|         Nothing

Any value with this shape will be handled by a previous pattern, so it should be
removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant