大家好,我已经在phoenix应用程序中实现了websocket。在成功连接到Websocket并将其连接到我的Websocket之前,但是现在我收到了此错误:
error] Ranch listener MarketPlaceDisbursementServiceWeb.Endpoint.HTTP had connection process
started with :cowboy_clear:start_link/4 at #PID<0.499.0> exit with reason: {%Jason.DecodeError
{data: "{ \"topic\": \"room:marketplace_disbursement_service\", \"event\": \"inquiry_response\",
\"payload\": {}, \"ref\": 0 }", position: 2, token: nil}, [{Jason, :decode!, 2, [file: 'lib/jason.ex', line: 78]}, {Phoenix.Socket.V1.JSONSerializer, :decode!, 2, [file: 'lib/phoenix/socket/serializers/v1_json_serializer.ex',
line: 29]}, {Phoenix.Socket, :__in__, 2, [file: 'lib/phoenix/socket.ex', line: 498]}, '{Phoenix.Endpoint.Cowboy2Handler, :websocket_handle, 2, [file: 'lib/phoenix/endpoint/cowboy2_handler.ex', line: 77]}, {:cowboy_websocket, :handler_call, 6, [file:
'/Users/jaisanas/work/backend/deps/cowboy/src/cowboy_websocket.erl', line: 471]}, {:cowboy_http, :loop,
2, [file: '/Users/jaisanas/work/backend/deps/cowboy/src/cowboy_http.erl', line: 233]}, {:proc_lib,
:init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}
这是我的mix.exs文件:
{:phoenix, "~> 1.4.0"},
{:phoenix_pubsub, "~> 1.1"},
{:phoenix_ecto, "~> 4.0"},
{:ecto_sql, "~> 3.0"},
{:postgrex, ">= 0.0.0"},
{:gettext, "~> 0.11"},
{:jason, "~> 1.0"},
{:plug_cowboy, "~> 2.0"},
{:httpoison, "~> 1.4"},
{:poison, "~> 3.1"}
在该线程上,github说我必须删除rm -rf _build
。但是它仍然返回错误,有人知道如何解决此错误吗?