I've taken the code exactly as indicated in the phoenix live view upload guide as seen here:
I'm running this on commit 0661fcc33141a2648247426a8094fbba1dc72bb4 on master.
The code will die here:
** (FunctionClauseError) no function clause matching in Phoenix.LiveView.UploadChannel.handle_in/3
(phoenix_live_view 0.15.0-dev) lib/phoenix_live_view/upload_channel.ex:54: Phoenix.LiveView.UploadChannel.handle_in("chunk", %{}, %Phoenix.Socket{assigns: %{chunk_timeout: 10000, chunk_timer: nil, done?: false, handle: #PID<0.552.0>, live_view_pid: #PID<0.546.0>, max_file_size: 783604, path: "C:\\Users\\rober\\AppData\\Local\\Temp/plug-1605/live_view_upload-1605815977-654831136887540-4", uploaded_size: 0}, channel: Phoenix.LiveView.UploadChannel, channel_pid: #PID<0.551.0>, endpoint: TzipperWeb.Endpoint, handler: Phoenix.LiveView.Socket, id: nil, join_ref: "9", joined: true, private: %{connect_info: %{session: %{"_csrf_token" => "hhLVz_h9pQZ1krJ2GKYaCIyh", "phauxth_session_id" => 82}}, log_handle_in: false, log_join: :info}, pubsub_server: Tzipper.PubSub, ref: "10", serializer: Phoenix.Socket.V2.JSONSerializer, topic: "lvu:0", transport: :websocket, transport_pid: #PID<0.543.0>})
Last message: %Phoenix.Socket.Message{event: "chunk", join_ref: "9", payload: %{}, ref: "10", topic: "lvu:0"}
It looks like the second parameter is wrong. It's expecting a map with the key :binary at the beginning and the empty parameter that somehow gets there is causing the no function clause matching error. I've been trying to figure out why this is happening. I have a validate handler.
You aren't running phoenix 1.5.7, which contains the binary serialization support. Thanks!
Thank you Chris! I've been pulling out my hair over this for the past couple of days.
Most helpful comment
You aren't running phoenix 1.5.7, which contains the binary serialization support. Thanks!