How to recompile rebar3 as a :telemetry dependency?

Very new user here. After upgrading to Erlang/OTP 25 via MacPorts, I get the following error from rebar3 when trying mix compile:

beam/beam_load.c(551): Error loading function rebar3:parse_args/1: op put_tuple u x:
  please re-compile this module with an Erlang/OTP 25 compiler

The error is a result of a :telemetry dependency.

I have tried deleting ./_build and ./deps and running mix local.rebar. I’ve also tried mix deps.unlock --all. Where else might a stale file live?

I noticed rebar / rebar3 are MacPorts packages, but they are not installed on my system.

Had this problem today, you need to update rebar3.

Check the lines following this error message:

  • if the path shows rebar is executed from an asdf path, then it means you installed it with the rebar asdf plugin. Update through asdf
  • otherwise you might need to update Elixir version, if possible

Feel free to post the lines following the ones you already posted.

try mix local.rebar --force

6 Likes

Thank you!! It was my Elixir version, indeed. The error lines were as below.

It turns out my Elixir version was pinned to 1.12.3 because I had myself packaged that version for MacPorts and never removed it from my local macports repo :man_facepalming:t3:

After upgrading elixir to 1.13.4, mix local-rebar --force and mix compile worked as expected.

** (Mix) Could not compile dependency :telemetry, "~/.mix/rebar3 bare compile --paths ~/project/_build/dev/lib/*/ebin" command failed. You can recompile this dependency with "mix deps.compile telemetry", update it with "mix deps.update telemetry" or clean it with "mix deps.clean telemetry"

Thank you man :partying_face:

Solved for me :smiley:

1 Like