(Mix) Could not compile dependency :telemetry

Hi. I am trying to update older project to latest elixir, phoenix and all dependencies.

I am still running into (Mix) Could not compile dependency :telemetry

I’ve googled solutions, tried reinstalling rebar, etc. But still can’t figure it out. I have to say I’m a bit out of my depth here.

This is the full error:

❯ mix compile
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `(/Users/josefrichter/.asdf/installs/elixir/1.14.3-otp-25/.mix/elixir/1-14/rebar3 bare compile --paths /Users/josefrichter/Dropbox (Personal)/code/elixir/organizer/_build/dev/lib/*/ebin'
** (Mix) Could not compile dependency :telemetry, "/Users/josefrichter/.asdf/installs/elixir/1.14.3-otp-25/.mix/elixir/1-14/rebar3 bare compile --paths /Users/josefrichter/Dropbox (Personal)/code/elixir/organizer/_build/dev/lib/*/ebin" command failed. Errors may have been logged above. 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"

Any suggestions, please? Thank you.

First of all try to remove the _build directory in your project, then if it doesn’t help make sure that your elixir is compiled with correct OTP version, for example in your case your elixir is compiled with OTP 25, so you should have this version as OTP you are using currently.

All this seems to be ok, I tried all that. I even tried to reinstall elixir, rebar, etc. to make sure all versions are correct. But now I’m already running out of ideas.

I see you are using the SH, have you tried using bash, I used to have some problems with sh myself, especially on alpine containers.

I’ve been using zsh, but tried toggling to bash and sh too. Still the exact same error.

I am using asdf, if that plays any role.

The clash seems to be between rebar3 and telemetry.

Any ideas, please?

I’d suggest trying a path without spaces and/or parenthesis.

2 Likes

Yeah maybe try escaping the white space in the path

1 Like

Usually one is not in control of the places those paths are handled in. Therefore I still suggest avoiding such paths for development to begin with.

1 Like

That actually worked :open_mouth::see_no_evil: Thank you!

1 Like

I’ve had this exact same issue in the past. It would be nice if the error said something like “destination not found” or something maybe

1 Like

Can you open an issue on Elixir about this? It looks like the mix compiler that calls rebar3 isn’t escaping or quoting paths.

This is strange because on windows it works with path with spaces (as far as I know).

Edit: I’ve tested just now a new phoenix project and it works without problems, path: C:\Program Files\

Just for the record I do agree with this as a best practice