I’m learning phoenix live view and while trying to run my project I get this error:
[info] Application teppelin exited: Teppelin.Application.start(:normal, []) returned an error: shutdown: failed to start child: TeppelinWeb.Endpoint
** (EXIT) an exception was raised:
** (UndefinedFunctionError) function Plug.Cowboy.child_spec/1 is undefined (module Plug.Cowboy is not available)
Plug.Cowboy.child_spec([scheme: :http, plug: {TeppelinWeb.Endpoint, []}, options: [dispatch: [_: [{:_, Phoenix.Endpoint.Cowboy2Handler, {TeppelinWeb.Endpoint, []}}]], port: 4000, otp_app: :teppelin]])
(phoenix) lib/phoenix/endpoint/cowboy2_adapter.ex:44: Phoenix.Endpoint.Cowboy2Adapter.child_spec/3
(phoenix) lib/phoenix/endpoint/supervisor.ex:108: anonymous fn/6 in Phoenix.Endpoint.Supervisor.server_children/4
(elixir) lib/enum.ex:1948: Enum."-reduce/3-lists^foldl/2-0-"/3
(phoenix) lib/phoenix/endpoint/supervisor.ex:99: Phoenix.Endpoint.Supervisor.server_children/4
(phoenix) lib/phoenix/endpoint/supervisor.ex:59: Phoenix.Endpoint.Supervisor.init/1
(stdlib) supervisor.erl:295: :supervisor.init/1
(stdlib) gen_server.erl:374: :gen_server.init_it/2
(stdlib) gen_server.erl:342: :gen_server.init_it/6
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
I already tried switching from cowboy to plug_cowboy but it didn’t work. This is my deps function:
defp deps do
[
{:phoenix, "~> 1.4.9"},
{:phoenix_pubsub, "~> 1.0"},
{:phoenix_html, "~> 2.10"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:gettext, "~> 0.11"},
# {:cowboy, "~> 2.0"},
{:plug_cowboy, "~> 2.1"},
{:phoenix_live_view, "~> 0.3.1"},
{:poison, "~> 4.0"},
{:httpoison, "~> 1.5.0"},
]
end