Erlang Hackney Deps Not Installing

I’ve worked this problem for a while but am at my wit’s end.

I’m installing :ueberauth_facebook which depends on :oauth2 -> :hackney ->

    {deps, [
            {idna, "1.2.0"},
            {mimerl, "1.0.2"},
            {certifi, "0.7.0"},
            {metrics, "1.0.1"},
            {ssl_verify_fun, "1.1.1"}
           ]}.

I have rebar3 installed.

mix deps.get
mix phoenix.server
Error: ** (Mix) Could not start application idna: could not find application file: idna.app

So I added idna to my deps…

mix deps.get
mix phoenix.server
Error: ** (Mix) Could not start application mimerl: could not find application file: mimerl app

I’ve researched this to no end and can’t find the answer. Any suggestions is very appreciated!

1 Like

its mix deps.get, also you should do mix deps.compile as well.

1 Like

This may be cause by a bug in Elixir, if you update to 1.4.1 you should no longer have the issue. Another alternative is to fetch hackney from Hex.

It could also be the that you are using hackney 1.6.4 from Hex [1] that was pushed without dependencies, but you should be getting a warning in that case if you are using latest Hex :).

[1] https://hex.pm/packages/hackney/1.6.4

1 Like

Some luck…

I upgraded to 1.4.1,
brew update elixir
rm -rf deps
mix deps.get
mix phoenix.server

Same error.

** (Mix) Could not start application idna: could not find application file: idna app

Although the Hackney readme says 1.6.4, it looks to be 1.6.5. :oauth2 calls for {:hackney, "~> 1.6"}

The hackney rebar.config is:

%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et

{erl_opts, [debug_info,
            {platform_define, "R14", no_callback_support},
            {platform_define, "^[0-9]+", namespaced_types}
           ]}.

{xref_checks, [undefined_function_calls]}.

{cover_enabled, true}.
{eunit_opts, [verbose]}.

{post_hooks, [{clean, "rm -rf *~ */*~ */*.xfm test/*.beam"}]}.

{deps, [
        {idna, "1.2.0"},
        {mimerl, "1.0.2"},
        {certifi, "0.7.0"},
        {metrics, "1.0.1"},
        {ssl_verify_fun, "1.1.1"}
       ]}.

{profiles, [{docs, [{deps,
                     [
                      {edown,
                       {git, "https://github.com/uwiger/edown.git",
                        {tag, "0.8"}}}
                     ]},

              {edoc_opts, [{doclet, edown_doclet},
                           {packages, false},
                           {subpackages, true},
                           {top_level_readme,
                            {"./README.md", "http://github.com/benoitc/hackney"}}]}]},
             {test, [
               {deps, [{cowboy, "1.0.4"}]}
             ]}
           ]}.

So I added :hackney to my project’s deps…

[
    ...
        {:hackney, "~> 1.6.5"}
    ...
]

added it to my applications list

  def application do
    [mod: {App, []},
     applications: [:phoenix, :phoenix_pubsub, :phoenix_html, :cowboy, :ueberauth, :logger, :gettext,
                    :phoenix_ecto, :postgrex, :httpotion, :hackney]]

mix deps.get

And then it found Hackney’s dependencies.

I then replaced :hackney with :ueberauth_facebook and it complied fine.

My end around worked, but if you or anyone knows the better solution, I’m interested in trying.

Thank you for your help!

1 Like

Everything that needs to be included for actual usage needs to be listed in your applications. Or if you are using the latest elixir then remove your applications list altogether and it should pick it up from your dependencies automatically. :slight_smile:

1 Like

When I included :ueberauth_facebook , it added the dependencies down to :hackney, but then wouldn’t load Hackney’s dependencies. Then I added :hackney as one of my project’s dependencies. But mix deps.get still wouldn’t load its dependencies.

However, when I added :hackney to my applications list and my dependency list, mix finally added Hackney’s dependencies.

Shouldn’t mix have loaded Hackney’s dependencies simply from adding :ueberauth_facebook originally?

1 Like