wking-io / elm-live

⚡ A flexible dev server for Elm. Live reload included.
https://elm-live.com
MIT License
1.05k stars 61 forks source link

Not actually building when it says it does #230

Open abrevinci opened 4 years ago

abrevinci commented 4 years ago

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.

ostwilkens commented 4 years ago

I am also experiencing this. I need to remove elm.js and re-save my code for it to actually build.

lucamug commented 4 years ago

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

ostwilkens commented 4 years ago

I'm running elm 0.19.1 on w10, not using parameters. This only happened when I was using the --output parameter.

lucamug commented 4 years ago

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.

ostwilkens commented 4 years ago

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.

lucamug commented 4 years ago

"Compiled in DEV mode..." is usually a message you get in the browser console. Are you getting that message in the terminal?

ostwilkens commented 4 years ago

Yeah, super weird! It's the same message I get in the chrome console.

choonkeat commented 4 years ago

I suspect this is a executable PATH issue

elm 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

ostwilkens commented 4 years ago

@choonkeat That makes a whole lot of sense! I'm not able to test it right now, but you're probably correct.