rsshek

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”

First 10 of 13 Posts! Switch mode

dimitarvp

dimitarvp

Have you tried mix deps.update rabbit_common and then attempting to compile again?

rsshek

rsshek

yes, same error persists.
I even tried git cloning into a new folder and installed deps from scratch but no luck.

hauleth

hauleth

maybe in 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

ruslandoga

In addition to the above, here’s more info on maybe Expressions — Erlang System Documentation v29.0.2

lud

lud

Hello @rsshek, welcome to the forums :slight_smile:

Can you upgrade to OTP 27? The maybe keyword will be supported out of the box.

Otherwise, can you try with this environment ERL_FLAGS='-enable-feature maybe_expr'?

rsshek

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

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

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 text

lud

lud

Hum strange :thinking:

I have had the same error before but generally I clean everything and it works. Have you tried with the ERL_FLAGS variable?

rsshek

rsshek

yes tried. same error

Last Post!

D4no0

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.

Where Next?

Trending in Questions Top

jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
silverdr
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated! To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead. Sta...
New
saveman71
Hello ! We want new/edit form pages to POST/PUT to their own URL rather than the resources REST defaults (post /things, put /things/:id)...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
michallepicki
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New

We're in Beta

About us Mission Statement