[erlang-questions] JSX 2.8.0 Issue

Theepan vasdeveloper@REDACTED
Sun Jul 31 23:10:02 CEST 2016


Hi There,

I encounter an issue with JSX where --


jsx:encode(maps:to_list(#{<<"library">> => <<"jsx">>, <<"awesome">> =>
true})). -- works both on both OSX and CentOS.

But --

jsx:encode(#{<<"library">> => <<"jsx">>, <<"awesome">> => true}). -- works
on OSX but not on CentOS.

I am using the same JSX version on both the machines, and I am using the
example from the JSX GitHub page.

Please see the logs below:


ON CENTOS
---------

(eventcx_server@REDACTED)18>
(eventcx_server@REDACTED)18>
(eventcx_server@REDACTED)18>
(eventcx_server@REDACTED)18> jsx:encode(#{<<"library">> => <<"jsx">>,
<<"awesome">> => true}).
** exception error: bad argument
     in function  jsx_parser:value/4 (../src/jsx_parser.erl, line 163)
(eventcx_server@REDACTED)19>
(eventcx_server@REDACTED)19>

(eventcx_server@REDACTED)19>
(eventcx_server@REDACTED)19> jsx:encode(maps:to_list(#{<<"library">> =>
<<"jsx">>, <<"awesome">> => true})).
<<"{\"awesome\":true,\"library\":\"jsx\"}">>
(eventcx_server@REDACTED)20>
(eventcx_server@REDACTED)20>
(eventcx_server@REDACTED)20> [Quit]

[root@REDACTED eventcx_server]#
[root@REDACTED eventcx_server]# uname -a
Linux echowave 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015
x86_64 x86_64 x86_64 GNU/Linux
[root@REDACTED eventcx_server]#


ON OSX
-------

1>
1>
1> jsx:encode(#{<<"library">> => <<"jsx">>, <<"awesome">> => true}).
<<"{\"awesome\":true,\"library\":\"jsx\"}">>
2>
2>


2>
2> jsx:encode(maps:to_list(#{<<"library">> => <<"jsx">>, <<"awesome">> =>
true})).
<<"{\"awesome\":true,\"library\":\"jsx\"}">>
3>
3>
3> q().
ok


4> Piriyatheepans-MacBook-Pro:~ piriyatheepan$
Piriyatheepans-MacBook-Pro:~ piriyatheepan$ uname -a
Darwin Piriyatheepans-MacBook-Pro.local 15.4.0 Darwin Kernel Version
15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64
x86_64
Piriyatheepans-MacBook-Pro:~ piriyatheepan$
Piriyatheepans-MacBook-Pro:~ piriyatheepan$
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160801/a7751518/attachment.htm>


More information about the erlang-questions mailing list