lydell/elm-watch

elm-watch hangs on error

Closed this issue · 6 comments

Whenever some command like elm-watch make fails (see #91 ), the command does not exit with an error, but instead requires the user to press Ctrl+C to exit. This is fine in interactive terminals, but when calling the builder with e.g. subprocess.check_call for automation, this hangs the calling process. It would be nice to either check whether the current shell is interactive or allow overriding this behavior with a flag

Hi! How do I reproduce this?

Interestingly I can't reproduce it outside of our project.

The code that gets triggered is this:

"Exiting elm-watch. Press ctrl+c (again) to force."

The way I produce the error I'm getting is the following:

  • Install elm and elm-watch: npm i elm elm-watch
  • Create a new elm project with npx elm init
  • Create a default elm-watch config with npx elm-watch init
  • Create a very simple src/Main.elm, e.g. containing main = "test"
  • Run ELM_HOME=<a directory you cannot write to> npx elm-watch make

This results in a permission denied error and then crashes with thread blocked indefinitely in an MVar operation.

What I don't get:

All environments (even calling it from subprocess.run in python, which is annoying) have process.stdout.isTTY set to true. But the "Exiting elm-watch" message is only displayed in our project.

I'll try to isolate the issue some more, it feels like something is getting stuck, specifically in our environment.

I’m closing this for now. Feel free to post more info when you find it and we’ll reopen!

Looks like it only happens when you have postprocess set in elm-watch.json.

Fix released in v1.1.3.

Hey, thanks for keeping up with this even when I wasn't very responsive. I kinda got pulled to other topics after I failed to reproduce this properly