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

elm-pages build --base sub does not render correctly #217

Closed
j-maas opened this issue Aug 28, 2021 · 1 comment · Fixed by #234
Closed

elm-pages build --base sub does not render correctly #217

j-maas opened this issue Aug 28, 2021 · 1 comment · Fixed by #234

Comments

@j-maas
Copy link
Contributor

j-maas commented Aug 28, 2021

The dev server strips the base properly. But when I try to build, the index is rendered into a subfolder and contains a rendered error message about it being an invalid route. See this test HTML output for an index file for an example.

Reproduction

  1. Check out https://github.com/Y0hy0h/unnecessarily-bad-design/tree/e93e004dcd3cfdc81cf67a1eb23c01d1a095ea38. (I currently don't have a simpler elm-pages repo. The ./examples don't build for me.)
  2. npm install
  3. npm build -- --base sub
  4. Look into ./dist. There is a ./dist/sub/index.html that says "Page Not Found".
@j-maas
Copy link
Contributor Author

j-maas commented Sep 14, 2021

I discovered that this is because Route.toPath converts the Pages.Index to /sub/, but that is put into Path.fromString which chops the trailing slash, leaving /sub.

I assume there is some code somewhere that removes the base path from these paths, but since the base path is /sub/ with a trailing slash, it does not affect /sub which is left to be wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant