Sunday, February 4, 2018

Elm on github.io using compiled JS

I ran into an issue using Elm on my github.io pages. My case involved using an index.html page to load the compiled JavaScript.

I used the following reference in the elm-package.json file:

"repository": "https://github.com/jbrgfx/jbrgfx.github.io.git"

Then I generated the JS using elm-make:

elm-make src/Main.elm --output elm.js

Once I committed the change and pushed it to github, my github.io site and the source on my workstation failed to render because of the repo name and its use of dotted separators.

Since my project was built on top of another repo, I changed the reference in the elm-package.json file to the original repo which did not contain dotted separators in the name.

After recompiling, adding and pushing the change, my github.io site was back online.

This fix worked because the dependencies in the both projects were identical; pointing github.io to another package source is an established way of launching github,io pages. I did it as an after-thought and a necessity once I saw the cause of my perdicament. I could have made the choice to import the original project as the base of the pages project and built from that original.

Found note on Elm-discuss indicating that others have spotted the issue.

Elm developers with a CName should not have to worry about this issue.

Review the elm-package.json source on github.

No comments:

Post a Comment