Open abrevinci opened 4 years ago
I am also experiencing this. I need to remove elm.js and re-save my code for it to actually build.
This should not be the case. Are you able to share your setup?
Could this be the issue? https://github.com/wking-io/elm-live/issues/220
I'm running elm 0.19.1 on w10, not using parameters. This only happened when I was using the --output parameter.
The output parameter is a very common parameter that everybody use. So I think is about something else. It is difficult to tell without any other information.
I just tried just doing elm make src/Main.elm --output elm.js
, which is broken as well, so I guess this isn't (exclusively) a problem with elm-live. Elm-live does say the compilation is successful though, which is misleading.
First build:
elm make src/Main.elm --output elm.js Success! Compiled 1 module. Main ---> elm.js
Build when elm.js exists:
elm make src/Main.elm --output elm.js Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
Have no clue what's going on here.. seems like elm.js is being executed instead of overwritten? I should open a ticket over at elm/compiler.
"Compiled in DEV mode..." is usually a message you get in the browser console. Are you getting that message in the terminal?
Yeah, super weird! It's the same message I get in the chrome console.
I suspect this is a executable PATH issue
elm make src/Main.elm --output elm.js
elm.js
does NOT exist, your shell finds the correct elm binary and executes itelm.js
exists, it is in your $PATH
and your shell finds your elm.js
and executes it. i.e. the command is actually elm.js make src/Main.elm --output elm.js
This explains why you see the output Compiled in DEV mode...
which is an output of running the compiled elm js code.
I'd suggest you use another name other than elm.js
.
see also https://discourse.elm-lang.org/t/weird-action-by-caused-by-elm-js/4365/2
@choonkeat That makes a whole lot of sense! I'm not able to test it right now, but you're probably correct.
When running with elm-live, as soon as I make a change it says it is building and succeeds. But the change does not appear in the built elm.js file. Also, if I intentionally introduce a compilation error, elm-live still reports success. Here is the command I am using:
elm-live src/Main.elm --pushstate -- --output=elm.js
Am I missing something or is this an actual bug? I am running version 4.0.2 of elm-live.
Work-around is to quit elm-live, do a regular elm make and then restart elm-live again. Extremely frustrating and kind of defeating the purpose. But I must use elm-live since reactor does not work with client-side routing.