rdlh/onset-phone

json_encode error in client file

Closed this issue · 2 comments

Having issues with json_encode in client file.

ExecuteWebJS(web, "initPhone({ currentUserPhone: '"..phoneNumber.."', money: "..money..", contacts: "..json_encode(contacts)..", messages: "..json_encode(messages).."});")

The above line for example will spit an error :
[string "phone/client.lua"]:28: attempt to call a nil value (global 'json_encode')

If I import json.lua into the client files in package.json, I get a new error
[string "phone/json.lua"]:68: attempt to call a nil value (global 'rawget')

Was using wrong version on json.lua - Fixed!

rdlh commented

Hi @Dimmies !

Yeap we're using a fixed and updated version of json.lua (the default one is furiously buggy)