Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Don't crash Brunch process when Elm compilation fails #33

Merged
merged 1 commit into from
May 31, 2017

Conversation

antonyshchenko
Copy link
Contributor

Currently brunch watch process crashes whenever there is a compilation error in Elm code. This is an attempt to fix the issue which works for me currently.

@dustinfarris
Copy link
Contributor

i have not experienced any crashes during brunch watch. i wonder if this is specific to your setup?

@antonyshchenko
Copy link
Contributor Author

@dustinfarris I was running it inside Docker container. Here is a repo where crash is reproducible: https://github.com/env0der/elmbrunch_crash

Everything works perfectly when I run it on Mac OS, though.

@madsflensted
Copy link
Owner

@env0der are you sure it is a compilation error? The childExecution will fail only if something is terribly wrong (e.g. can't find compiler or similar).

What kind of error are you getting from the call of the compiler?

@antonyshchenko
Copy link
Contributor Author

@madsflensted it's documented in the repo https://github.com/env0der/elmbrunch_crash:

20:05:34 - error: Command failed: elm-make --yes --output ../../priv/static/js/elm/main.js Main.elm
-- NAMING ERROR ------------------------------------------------------- Main.elm

Cannot find type `Htm`

6| main : Htm a
          ^^^
Maybe you want one of the following?

    Html
    Html.Html


Stack trace was suppressed. Run with `LOGGY_STACKS=1` to see the trace.
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: spawn notify-send ENOENT
  at exports._errnoException (util.js:1022:11)
  at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
  at onErrorNT (internal/child_process.js:359:16)
  at _combinedTickCallback (internal/process/next_tick.js:74:11)
  at process._tickCallback (internal/process/next_tick.js:98:9)

@madsflensted madsflensted merged commit 4e2a21a into madsflensted:master May 31, 2017
@madsflensted
Copy link
Owner

Finally had time to look at this. I had missed that execSync throws exception on any non-zero exit codes from the child process.
May need to add some output handling as well.

Thank you for contributing.

@chazsconi chazsconi mentioned this pull request Jul 18, 2017
7 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants