我刚刚生成了一个新的实时视图应用程序,phx.new --live
并且不断收到此错误:
[info] GET /orgs
[debug] Processing with Phoenix.LiveView.Plug.index/2
Parameters: %{}
Pipelines: [:browser]
[debug] QUERY OK source="orgs" db=3.6ms idle=1614.0ms
SELECT o0."id", o0."avatar_url", o0."description", o0."email_end", o0."name", o0."inserted_at", o0."updated_at" FROM "orgs" AS o0 []
[info] Sent 200 in 4ms
[info] CONNECTED TO Phoenix.LiveView.Socket in 215µs
Transport: :websocket
Serializer: Phoenix.Socket.V2.JSONSerializer
Parameters: %{"_csrf_token" => "...", "vsn" => "2.0.0"}
[error] an exception was raised:
** (FunctionClauseError) no function clause matching in Phoenix.LiveView.Channel.start_link/1
(phoenix_live_view) lib/phoenix_live_view/channel.ex:12: Phoenix.LiveView.Channel.start_link({TopicalWeb.Endpoint, {#PID<0.3487.0>, #Reference<0.1633886798.3560439811.208106>}})
(elixir) lib/dynamic_supervisor.ex:690: DynamicSupervisor.start_child/3
(elixir) lib/dynamic_supervisor.ex:676: DynamicSupervisor.handle_start_child/2
(stdlib) gen_server.erl:661: :gen_server.try_handle_call/4
(stdlib) gen_server.erl:690: :gen_server.handle_msg/6
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
复制信息
我用的是凤凰版1.5.3
然后我生成了一个“组织”模块mix phx.gen.live Orgs Org orgs name:string email_end:string avatar_url:string description:string
scope "/orgs", TopicalWeb.OrgLive do
live "/", Index, :index
live "/new", Index, :new
live "/:id/edit", Index, :edit
live "/:id", Show, :show
live "/:id/show/edit", Show, :edit
end