WeChat game: SyntaxError:JSON Parse error: Unexpected EOF Stack:parse(native code)

Insert picture description here
According to the code to locate

JSON.parse(jsonstr)

JSON.parse() can convert the string of the JSON rule to JSONObject and
parse the error according to the error prompt, then the question is whether the string object of jsonstr is a json rule

Solution
Directly find in your code whether the json string "jsonstr" is "";
if JSON.parse("") is parsed in this way, debugging in the WeChat developer tool will not display an error, only Will only be displayed on the phone preview

Guess you like

Origin blog.csdn.net/weixin_46005137/article/details/115005627