-
Notifications
You must be signed in to change notification settings - Fork 63
Example of custom html #76
Comments
Can you ask this question on the elm-discuss mailing list and link to this issue? I think someone in the community can help. |
Same problem here, and unfortunately the OP didn't get his problem solved on the mailing list: https://groups.google.com/forum/#!topic/elm-discuss/sv06t77n_MA |
I am no expert on this matter by any means, but I ran into the same issue today and managed to come up with a solution (at least a temporary one). My directory structure is:
Basically I just included elm.js in my index.html file like: <head>
...
<script type="text/javascript" src="/_reactor/debug.js"></script>
<script type="text/javascript" src="/elm.js"></script>
...
</head>
...
<script type="text/javascript">
var main = Elm.fullscreenDebug('Portal', './App.elm');
</script> Module header in App.elm: module Portal (main) where
... The elm.js is only generated when you open App.elm from reactor directly -- but you only have to this once. For subsequent changes it gets automatically updated when you use the debugger through Index.html. Hope it helps, at least for beginners. |
FWIW, I just pushed a commit to a tiny app I'm tinkering with while learning Elm that adds a proxy server for Elm reactor. Here's the code: hauntedhost/elm-buzzword-bingo@2ac3070 TL;DR, run |
@gaborv Just a quick question, where does the debug.js comes from ? I thought that simply running the reactor would create the _reactor dir (I was thinking it was a temporary dir) but it didn't happen. Edit: Nevermind, the issue I was facing was related to the fact my ELM_HOME was not properly set. |
@PedroSena Could you share what you discovered about your ELM_HOME. I'm having Reactor issues on Ubuntu with node via npm and fear y ELM_HOME is not right. But the docs are vague... |
No luck after trying your setup @gaborv :(
|
I also struggled with this for a while but managed to get it working now. Thought I share my setup as a minimal, stripped down example: https://github.com/basti1302/elm-reactor-custom-html/tree/1.1.0 This setup uses the elm-platform provided via npm and uses npm run scripts to set ELM_HOME correctly. Kind regards Bastian |
@basti1302 to the best of my knowledge (which is very little) your example does not allow hotswapping, any ideas how to achieve that? |
Hi @dzannotti! It does allow hotswapping -- that is, you change your elm files and the browser reloads automatically, showing the updated version of your app. Make sure to follow the steps from https://github.com/basti1302/elm-reactor-custom-html/tree/1.1.0#development-mode In particular, you need to start the server with Kind regards Bastian |
@gaborv : like @nicolashery I am getting
Note that I am using the full Elm Architecture, i.e. with ports |
@simonh1000 I'm getting the same error:
It first happened to me when trying to do custom HTML with Maybe this should be spun off as a distinct issue? |
I just wrote a quick tutorial on this http://boonofcode.svbtle.com/setting-up-an-atom-elm-dev-environment Feedback/criticism/improvements welcom |
@league @nicolashery @simonh1000 The |
https://github.com/tomekwi/elm-live seems to be a nice option for this work flow, though hopefully elm-reactor adds support for something like this soon. |
I can't figure out how to use elm reactor with custom html, an example would help quite a lot I think.
Just going by the documentation, this is what I tried.
This is what my directory looks like:
custom.html
looks like this.I'm not sure it matters but
MyProject/Main.elm
looks like this:The error shown on the page as well as in the console is just, "Cannot read property 'Main' of undefined"
I did tried stepping through the debugger. It fails to load find my module here.
Indeed, the only modules it has are these ones:
I'm not sure where to go at this point. Could anyone share an example showing how to get this up and running?
The text was updated successfully, but these errors were encountered: