riverrun / phauxth

Not actively maintained - Authentication library for Phoenix, and other Plug-based, web applications
409 stars 21 forks source link

Failed to compile #92

Closed mikhailbot closed 6 years ago

mikhailbot commented 6 years ago

I'm trying to setup an existing app that includes phauxth and running into a weird issue. App works fine on other machines (also MacOS)

OS: MacOS 10.13.6 Erlang: 20.3.8.9 Elixir: 1.4.5

Deps:

      {:phoenix, "~> 1.3.0"},
      {:phoenix_pubsub, "~> 1.0"},
      {:phoenix_ecto, "~> 3.2"},
      {:postgrex, ">= 0.0.0"},
      {:gettext, "~> 0.11"},
      {:phauxth, "~> 1.2"},
      {:argon2_elixir, "~> 1.2"},
      {:cowboy, "~> 1.0"},
      {:cors_plug, "~> 1.5"},
      {:bamboo, "~> 1.0"},
      {:bamboo_smtp, "~> 1.5.0"},
      {:phoenix_html, "~> 2.11.2"},

Error:

== Compilation error on file lib/phauxth/user_messages.ex ==
** (FunctionClauseError) no function clause matching in :lists.foreach/2
    (stdlib) lists.erl:1337: :lists.foreach(#Function<1.120176160/1 in Module.make_overridable/2>, Phauxth.UserMessages.Base)
    lib/phauxth/user_messages.ex:42: (module)
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6

could not compile dependency :phauxth, "mix compile" failed. You can recompile this dependency with "mix deps.compile phauxth", update it with "mix deps.update phauxth" or clean it with "mix deps.clean phauxth"

I've done nothing more than clone the existing working repo, install elixir/erlang with asdf and try mix deps.get and then mix ecto.create which then fails with the above.

riverrun commented 6 years ago

Could you try removing the _build directory and then running mix ecto.create?

mikhailbot commented 6 years ago

Could you try removing the _build directory and then running mix ecto.create?

No go sadly! Also deleted it and tried mix compile --force but still refuses to compile. I'm going to try updated elixir and erlang versions and see if that is it, but I didn't think my versions where that far behind!

riverrun commented 6 years ago

I think I see what the problem is - I will push a fix now

mikhailbot commented 6 years ago

Hmm OK because I just upgraded versions and it seems to work with:

elixir 1.7.4
erlang 21.1.1
riverrun commented 6 years ago

I just pushed a fix to hex - version 1.2.9. The problem was that I was using a feature added in Elixir 1.5 in the UserMessages.Base module - that's why it works with newer versions.

mikhailbot commented 6 years ago

Working smoothly now, thanks a ton đź‘Ť