Cannot start observer: (UndefinedFunctionError) function :observer.start/0 is undefined

Amazing, thank you!

Since 1.15, Elixir prunes unused code paths. Adding the following line to project/1 callback of your mix.exs would do.

    prune_code_paths: Mix.env() == :prod,

This hack also works for some other erlang stuff, like common_test I needed in Enfiladex.

1 Like

TIL about the Elixir code pruning, thank you!

1 Like

This works, but also means youā€™re now only pruning paths in production, so all issues related to it only surface in production.

2 Likes

I use 4 environments, the commons and :ci for GHA/CI, in which I donā€™t prune codepaths (and mimic :prod in general.)

What can be the potential issues? Sorry, Iā€™m not very knowledgeable about this, can you please elaborate a bit?

1 Like

Afaik mostly missing out on the speedups code path pruning are meant to bring. But Iā€™ve seens code path pruning affect how you interact with applications you donā€™t explicitly depend on (in dev), like: Observer in iex -S mix - #5 by axelson

1 Like

Iā€™m reading this too because I couldnā€™t start observerā€¦ :sweat_smile: Speed reasons, understandable.

1 Like

I ran with the same issue with my Mac. Reinstalling Xcode developer tools solved it for me