Open TSFoster opened 3 years ago
You'll also need to add it to the list of prerendered routes in routes
, if you run the dev server it should tell you that it matches the Route but didn't find that specific page in the prerendered list. You'll need to add empty list as the dev server error suggests.
Sorry, I should have mentioned that I had added { slug = Nothing }
to Page.Slug__.routes
when trying to npm run build
. It still doesn't work for src/Page/Slug__.elm
how it does src/Page/Example/Slug__.elm
. It creates dist/index.html
, but the contents of it are the same as when running the dev server.
This is a screenshot of the dev server after running elm-pages add Slug__; elm-pages add Example.Slug__
.
Edit: just want to clarify, /
is the only route that doesn't work in this scenario. /foo
, /example/
and /example/foo
all match as expected.
I don't want the elm-pages site I'm building to treat the homepage any differently from any other first-level page (I'm using a headless CMS and the homepage has the same page type as any other page).
I ran
elm-pages add Slug__
without issue, but when I runnpm run start
and visit http://localhost:1234/ ornpm run build
and look at the dist/index.html, I get the "No route found for …" error page.