IEX Recompile Error - (MatchError) no match of right hand side value: {:error, {:already_loaded, :my_app}}

iex(2)> recompile
Compiling 1 file (.ex)
** (MatchError) no match of right hand side value: {:error, {:already_loaded, :my_app}}
    (mix_unused 0.2.1) lib/mix/tasks/compile.unused.ex:168: Mix.Tasks.Compile.Unused.all_functions/1
    (mix_unused 0.2.1) lib/mix/tasks/compile.unused.ex:132: Mix.Tasks.Compile.Unused.after_compiler/4
    (elixir 1.13.4) lib/enum.ex:2396: Enum."-reduce/3-lists^foldl/2-0-"/3
    (mix 1.13.4) lib/mix/tasks/compile.all.ex:72: Mix.Tasks.Compile.All.compile/4
    (mix 1.13.4) lib/mix/tasks/compile.all.ex:59: Mix.Tasks.Compile.All.with_logger_app/2
    (mix 1.13.4) lib/mix/tasks/compile.all.ex:36: Mix.Tasks.Compile.All.run/1
    (mix 1.13.4) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.13.4) lib/mix/tasks/compile.ex:131: Mix.Tasks.Compile.run/1

Does mix_unused need to be modified so that the app can be restarted without having to exit IEX first? If not, what’s the best way to resolve this issue?

Generally speaking, you should use mix_unused only once. You should remove this from compilers list once you’ve used mix_unused.

CC @hauleth

2 Likes

Sounds like a bug. Can you please create an issue on GH?

1 Like

Done: ** (MatchError) no match of right hand side value: {:error, {:already_loaded, :my_app}} · Issue #41 · hauleth/mix_unused · GitHub

Please let me know if you need any additional details, thanks.

1 Like