This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
helpButton.on("click", event => { | |
chan.push("help_needed", {}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[error] GenServer #PID<0.299.0> terminating | |
Last message: %Phoenix.Socket.Message{event: "help_needed", payload: %{}, ref: "2", topic: "help"} | |
State: %Phoenix.Socket{assigns: %{}, channel: HelpPlease.HelpChannel, channel_pid: #PID<0.299.0>, endpoint: HelpPlease.Endpoint, joined: true, pubsub_server: HelpPlease.PubSub, ref: nil, topic: "help", transport: Phoenix.Transports.WebSocket, transport_pid: #PID<0.297.0>} | |
** (exit) an exception was raised: | |
** (RuntimeError) Expected `handle_in/3` to return one of: | |
{:noreply, Socket.t} | | |
{:reply, {status :: atom, response :: map}, Socket.t} | | |
{:reply, status :: atom, Socket.t} | | |
{:stop, reason :: term, Socket.t} | | |
{:stop, reason :: term, {status :: atom, response :: map}, Socket.t} | | |
{:stop, reason :: term, status :: atom, Socket.t} | |
got {:no_reply, %Phoenix.Socket{assigns: %{}, channel: HelpPlease.HelpChannel, channel_pid: #PID<0.299.0>, endpoint: HelpPlease.Endpoint, joined: true, pubsub_server: HelpPlease.PubSub, ref: "2", topic: "help", transport: Phoenix.Transports.WebSocket, transport_pid: #PID<0.297.0>}} | |
(phoenix) lib/phoenix/channel/server.ex:255: Phoenix.Channel.Server.handle_result/2 | |
(stdlib) gen_server.erl:593: :gen_server.try_dispatch/4 | |
(stdlib) gen_server.erl:659: :gen_server.handle_msg/5 | |
(stdlib) proc_lib.erl:237: :proc_lib.init_p_do_apply/3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def handle_in("help_needed", payload, socket) do | |
broadcast! socket, "help_needed", payload | |
{:no_reply, socket} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
socket "/ws" do | |
channel "help", HelpPlease.HelpChannel | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Old post, but someone in the irc channel found it and was hoping for a solution, so just putting an answer here :)
the correct response for help_channel.ex:3 is:
{:noreply, socket}
notice the missing underscore