smpallen99 / coherence

Coherence is a full featured, configurable authentication system for Phoenix
MIT License
1.27k stars 225 forks source link

** (UndefinedFunctionError) function Coherence.Responders.Html.session_create_success/2 is undefined (module Coherence.Responders.Html is not available) #358

Closed danieljaouen closed 6 years ago

danieljaouen commented 6 years ago

Here's the full error:

[error] #PID<0.497.0> running PhoenixTemplatesWeb.Endpoint (cowboy_protocol) terminated
Server: localhost:4000 (http)
Request: POST /sessions
** (exit) an exception was raised:
    ** (UndefinedFunctionError) function Coherence.Responders.Html.session_create_success/2 is undefined (module Coherence.Responders.Html is not available)
        Coherence.Responders.Html.session_create_success(%Plug.Conn{...})
        (coherence) lib/coherence/controllers/session_controller.ex:1: Coherence.SessionController.action/2
        (coherence) lib/coherence/controllers/session_controller.ex:1: Coherence.SessionController.phoenix_controller_pipeline/2
        (phoenix_templates) lib/phoenix_templates_web/endpoint.ex:1: PhoenixTemplatesWeb.Endpoint.instrument/4
        (phoenix) lib/phoenix/router.ex:278: Phoenix.Router.__call__/1
        (phoenix_templates) lib/phoenix_templates_web/endpoint.ex:1: PhoenixTemplatesWeb.Endpoint.plug_builder_call/2
        (phoenix_templates) lib/plug/debugger.ex:102: PhoenixTemplatesWeb.Endpoint."call (overridable 3)"/2
        (phoenix_templates) lib/phoenix_templates_web/endpoint.ex:1: PhoenixTemplatesWeb.Endpoint.call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:16: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) /Users/dan/src/phoenix_templates/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
danieljaouen commented 6 years ago

Figured this out.

guilpejon commented 6 years ago

@danieljaouen can you tell me how you solved this? I'm having the same problem on Heroku

pradosh987 commented 6 years ago

Create responders folder in controllers/coherence and add two files with following modules

defmodule Coherence.Responders.Json do
  use Responders.Json
end
defmodule Coherence.Responders.Html do
  use Responders.Html
end

OR Even better create new branch and run mix coh.install --reinstall and remove unnecessary stuffs.

guilpejon commented 6 years ago

Thanks @pradosh987, that worked!