0
Erlang 툴체인 (OTP, rebar3, cowboy, jsx ...)을 사용하여 webapp을 작성하고 있습니다. 런타임 중에 jsx:is_json/1
을 찾을 수 없기 때문에 다음 코드가 작동하지 않습니다.jsx가 포함되어 컴파일되었지만`jsx : is_json/1` 함수를 찾을 수 없습니다.
handle_login(Req, State) ->
{ok, Data, _} = cowboy_req:body(Req),
case jsx:is_json(Data) of
false -> cowboy_req:reply(400,
[
{<<"content-type">>, <<"application/json">>}
],
<<"Invalid JSON">>,
Req);
스택 트레이스 :
{[{reason,undef},
{mfa,{erbid_api_handler,handle,2}},
{stacktrace,
[{jsx,is_json,[<<"{\"username\":\"tom\"}">>],[]},
{erbid_api_handler,handle_login,2,
[{file,
"/Users/khanhhua/dev/project-erbid/_build/default/lib/erbid/src/erbid_api_handler.erl"},
{line,45}]},
{erbid_api_handler,handle,2,
... truncated for brevity
나는 문제를 해결하는 방법을 알고 있어야합니다. 감사.
응용 프로그램을 시작하기 위해 실행중인 rebar3 명령은 무엇입니까? – Stratus3D
@ Stratus3D 귀하의 의견을 보내 주셔서 감사합니다. '_build/default/rel/erbid_alpha/bin/erbid_alpha foreground'입니다. 어쨌든, 나는 어리석은 문제를 고쳤다. –