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

Not actually building when it says it does #230

Open
abrevinci opened this issue May 4, 2020 · 9 comments
Open

Not actually building when it says it does #230

abrevinci opened this issue May 4, 2020 · 9 comments

Comments

@abrevinci
Copy link

abrevinci commented May 4, 2020

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
Copy link

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

@lucamug
Copy link
Contributor

lucamug commented Aug 20, 2020

This should not be the case. Are you able to share your setup?

Could this be the issue? #220

@ostwilkens
Copy link

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

@lucamug
Copy link
Contributor

lucamug commented Aug 20, 2020

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
Copy link

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
Copy link
Contributor

lucamug commented Aug 21, 2020

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

@ostwilkens
Copy link

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

@choonkeat
Copy link
Contributor

choonkeat commented Aug 21, 2020

I suspect this is a executable PATH issue

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

  • when elm.js does NOT exist, your shell finds the correct elm binary and executes it
  • when elm.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

@ostwilkens
Copy link

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

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

No branches or pull requests

4 participants