I've added this to my rebar config:
https://github.com/rustyio/sync
My code is being run within the mochiweb src that is created by the default Makefile.
I'm calling applcation:start(sync), and then subsequently calling sync:go(), to trigger the "live reload" functionality.
Does this module not work well with mochiweb? I have valid erlang code that runs fine if I kill the start-dev.sh script and recompile (make).
This is the error I get in the crash report:
exception error: bad function #Fun<telegram_web.0.121416379>
in function mochiweb_http:call_body/2 (src/mochiweb_http.erl, line 142)
in call from mochiweb_http:headers/6 (src/mochiweb_http.erl, line 122)
The code in mochiweb_http.erl (line 122):
117 headers(Socket, Opts, Request, Headers, Body, HeaderCount) ->
118 ok = mochiweb_socket:exit_if_closed(mochiweb_socket:setopts(Socket, [{active, once}])),
119 receive
120 {Protocol, _, http_eoh} when Protocol == http orelse Protocol == ssl ->
121 Req = new_request(Socket, Opts, Request, Headers),
122 call_body(Body, Req),
It looks like the Body parameter to the headers() function is not valid.