Could not compile dependency :cowboy

remote: Compiling 11 files (.ex)
remote: Generated phoenix_pubsub app
remote: ===> Compiling cowlib
remote: ===> Compiling cowboy
remote: ===> Compiling src/cowboy_stream_h.erl failed
remote: src/cowboy_stream_h.erl:293: illegal pattern
remote: src/cowboy_stream_h.erl:294: variable ‘Reason’ is unbound
remote: src/cowboy_stream_h.erl:294: variable ‘Stacktrace’ is unbound
remote: src/cowboy_stream_h.erl:294: variable ‘Stacktrace’ is unbound
remote:
remote: ==> aliva
remote: ** (Mix) Could not compile dependency :cowboy, “/app/.mix/rebar3 bare compile --paths “/tmp/build_945bd606db5443ccbd58b41af4b4ce18/_build/prod/lib/*/ebin”” command failed. You can recompile this dependency with “mix deps.compile cowboy”, update it with “mix deps.update cowboy” or clean it with “mix deps.clean cowboy”
remote: ! Push rejected, failed to compile Elixir app.
remote:
remote: ! Push failed
remote: Verifying deploy…
remote:
remote: ! Push rejected to glacial-spire-19969.
remote:
To https://git.heroku.com/glacial-spire-19969.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to ‘https://git.heroku.com/glacial-spire-19969.git

You have to update your Erlang/OTP version on the server to at least Erlang/OTP 21 or downgrade the cowboy version.

3 Likes

thanks josevalim that is answer