janetruluck / ueberauth_instagram

Instagram OAuth2 Strategy for Überauth.
MIT License
11 stars 16 forks source link

Won't compile on Elixir 1.8.1 #3

Open abitdodgy opened 5 years ago

abitdodgy commented 5 years ago

I'm trying to use the lib with Elixir 1.8.1 and OTP 21.2 and it won't compile:

== Compilation error in file lib/ueberauth/strategy/instagram.ex ==
** (CompileError) lib/ueberauth/strategy/instagram.ex:131: undefined function query_params/2
    (elixir) src/elixir_locals.erl:107: :elixir_locals."-ensure_no_undefined_local/3-lc$^0/1-0-"/2
    (elixir) src/elixir_locals.erl:108: anonymous fn/3 in :elixir_locals.ensure_no_undefined_local/3
    (stdlib) erl_eval.erl:680: :erl_eval.do_apply/6
could not compile dependency :ueberauth_instagram, "mix compile" failed. You can recompile this dependency with "mix deps.compile ueberauth_instagram", update it with "mix deps.update ueberauth_instagram" or clean it with "mix deps.cl

To recreate, create a new mix project and add the dependencies.

mix new ueber_test
  defp deps do
    [
      {:ueberauth, "~> 0.6.1"},
      {:ueberauth_instagram, "~> 0.2.0"}
    ]
  end

Then run mix deps.get && mix deps.compile.

I tried with ueberauth 0.4 and 0.6. Made no difference.

abitdodgy commented 5 years ago

Looking at this again, it seems that this line is the issue:

defp user_query(conn) do
    conn
    |> Map.merge(query_params(conn, :profile))
    |> URI.encode_query
  end

But it's not clear where query_params/2 is coming from. In 1.7.3 everything compiles normally. I had a look at all the dependencies but could not find this function. I made sure to look through the mix lock to ensure I was looking at the correct versions of the dependency.

I can only think that for some reason Elixir 1.7.3 compiles the lib without errors, but 1.8.1 refuses do so. Maybe differences between the way Elixir compiles between versions?

alexandremcosta commented 5 years ago

:+1: for this problem! @jasontruluck are you still maintaining this? Would you accept a PR to fix this, or you will do it yourself?