rsshek
Unable to compile the elixir project
Getting this error when running mix deps.compile.
I tried rm -rf deps _build mix.lock, reinstalling elixir via asdf. I am running out of ideas now. Any help is appreciated.
===> Compiling src/rabbit_heartbeat.erl failed
src/rabbit_heartbeat.erl:22:39: syntax error before: ‘maybe’
rabbit_heartbeat.erl:20:2: type heartbeaters() undefined
rabbit_heartbeat.erl:32:13: type heartbeaters() undefined
rabbit_heartbeat.erl:38:13: type heartbeaters() undefined
rabbit_heartbeat.erl:49:21: type heartbeaters() undefined
rabbit_heartbeat.erl:50:22: type heartbeaters() undefined
** (Mix) Could not compile dependency :rabbit_common, “/Users/ranbirs/.asdf/installs/elixir/1.17.3-otp-26/.mix/elixir/1-17/rebar3 bare compile --paths /Users/ranbirs/workspace/carts-api-bk2/carts-api/_build/dev/lib/*/ebin” command failed. Errors may have been logged above. You can recompile this dependency with “mix deps.compile rabbit_common --force”, update it with “mix deps.update rabbit_common” or clean it with “mix deps.clean rabbit_common”
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #elixirconf-us
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










First 10 of 13 Posts!
dimitarvp
Have you tried
mix deps.update rabbit_commonand then attempting to compile again?rsshek
yes, same error persists.
I even tried git cloning into a new folder and installed deps from scratch but no luck.
hauleth
maybein Erlang is enabled by default only since OTP 27, earlier you need to use some flag to enable it, but I am not sure how you can do it in Mix for dependencies.ruslandoga
In addition to the above, here’s more info on
maybeExpressions — Erlang System Documentation v29.0.2lud
Hello @rsshek, welcome to the forums
Can you upgrade to OTP 27? The
maybekeyword will be supported out of the box.Otherwise, can you try with this environment
ERL_FLAGS='-enable-feature maybe_expr'?rsshek
I was running this app on erlang erlang 26.2.5.5 just tomorrow and before and it was working fine. But I will explore more to see if this what can I do here
dimitarvp
I missed the Erlang version bit (serves me right for reading through the phone on the bed). Just upgrade to Erlang 27 and try it.
rsshek
tried with OTP 27 as well (elixir 1.18.1-otp-27)
getting same error again.
** (Mix) Could not compile dependency :rabbit_common, "/Users/ranbirs/.asdf/installs/elixir/1.18.1-otp-27/.mix/elixir/1-18/rebar3 bare compile --paths /Users/ranbirs/workspace/carts-api-bk2/carts-api/_build/dev/lib/*/ebin" command failed.Preformatted textlud
Hum strange
I have had the same error before but generally I clean everything and it works. Have you tried with the
ERL_FLAGSvariable?rsshek
yes tried. same error
Last Post!
D4no0
Currently the erlang AMQP client (and subsequent dependencies) don’t support OTP-27, the only option is to downgrade to OTP-26.
Here is the official link: Erlang Version Requirements | RabbitMQ
PS: I think there was somewhere a more detailed explanation on what it specifically breaks, but I cannot find it now.