Closed pthompson closed 4 years ago
This is strange to me. I'm wondering if you have something installed as a mix archive for Dialyxir but not Erlex? Can you run mix archive
?
This is what I get:
$ mix archive
* dialyxir-1.0.0
* hex-0.20.5
* phx_new-1.4.16
Archives installed at: /Users/patrick/.mix/archives
So the annoying thing about mix archives is that if they have dependencies (like Dialyxir does with Erlex) you need to install all dependencies as archives too. So in your case you need to install Erlex 0.2.6 as an archive, then your error should go away.
mix archive.install hex erlex
That did the trick, thanks!
Should that be added to the README?
We removed the section on directions for installing as archives a while back, as it's not the recommended way to do so (for reasons you discovered, among others; see: https://github.com/jeremyjh/dialyxir/pull/276) so I don't think so, in this case.
Got it, thanks for your help!
Environment
Erlang/OTP 22 [erts-10.7.1] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [hipe] [dtrace]
Elixir 1.10.2 (compiled with Erlang/OTP 22)
Which version of Dialyxir are you using? (cat mix.lock | grep dialyxir):
"dialyxir": {:hex, :dialyxir, "1.0.0", "6a1fa629f7881a9f5aaf3a78f094b2a51a0357c843871b8bc98824e7342d00a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "aeb06588145fac14ca08d8061a142d52753dbc2cf7f0d00fc1013f53f8654654"},
Current behavior
When I run mix dialyzer on my umbrella project, all of my error output looks like this:
Please file a bug in https://github.com/jeremyjh/dialyxir/issues with this message.
Unknown error occurred: %UndefinedFunctionError{arity: 1, function: :pretty_print, message: nil, module: Erlex, reason: nil}
Legacy warning: :0: Unknown function 'Elixir.IEx':'started?'/0
Please file a bug in https://github.com/jeremyjh/dialyxir/issues with this message.
Unknown error occurred: %UndefinedFunctionError{arity: 1, function: :pretty_print, message: nil, module: Erlex, reason: nil}
Legacy warning: :0: Unknown function 'Elixir.Mix':env/0
Please file a bug in https://github.com/jeremyjh/dialyxir/issues with this message.
Unknown error occurred: %UndefinedFunctionError{arity: 1, function: :pretty_print, message: nil, module: Erlex, reason: nil}
Legacy warning: :0: Unknown function 'Elixir.Mix.Project':config/0
Please file a bug in https://github.com/jeremyjh/dialyxir/issues with this message.
Unknown error occurred: %UndefinedFunctionError{arity: 1, function: :pretty_print, message: nil, module: Erlex, reason: nil}
Legacy warning: :0: Unknown type 'Elixir.MyProject.MyModule':t/0
. . .
Expected behavior
I would expect not to get the _Unknown error occurred: %UndefinedFunctionError{arity: 1, function: :prettyprint, message: nil, module: Erlex, reason: nil} errors.