Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
May your rolls be merry + bright! 🎄
Create a free account

Syntax error

This is an error I continue to get:  SyntaxError: Unexpected end of JSON input SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at apiscript.js:10617:30 at /home/node/d20-api-server/pubsub.js:63:16 at Object.publish (/home/node/d20-api-server/pubsub.js:68:8) at TrackedObj.set (/home/node/d20-api-server/api.js:1302:14) at updateLocalCache (/home/node/d20-api-server/api.js:1693:18) at /home/node/d20-api-server/api.js:2045:7 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) Any idea how to fix this??
What are you doing to get the error? Where does the error show?
1763992718
timmaugh
Forum Champion
API Scripter
If you install ScriptInfo from the 1-click, then use the line number from that error in a command line, it might be able to tell you what script this error is coming from (or at least where to start looking). Your line is "10617", so the command would be: !scriptinfo 10617 (Caveat: most times, installing a new script should add it at the END of the list of scripts you have... so if you already have 2000 lines of code for all of your installed scripts, the new script should start at line 2001. Rarely, however, installing a new script will NOT actually put it at the end of your scripts but a few scripts back from the end. If, after installing ScriptInfo and running the above command, we can't figure out which script this is coming from, you might need to generate this error again -- e.g., do the same action that triggers it -- so we can see if the line number of the error changes.)
This is what it gives me:  MODERATOR: Script Information SCRIPT NAME START / LINES GroupCheck (1.15) 357 / (1377) GroupInitiative (0.9.41) 1733 / (2263) PathMath (1.7) 6987 / (1657) TokenCollisions (1.7) 8644 / (902) ScriptInfo (0.0.3) 11011 / (143) Script Information (Line 357) Line 357 corresponds to line 0 in GroupCheck. Script Information (Line 1733) Line 1733 corresponds to line 1376 in GroupCheck. Script Information (Line 6987) Line 6987 corresponds to line 0 in PathMath. Script Information (Line 8644) Line 8644 corresponds to line 0 in TokenCollisions. Script Information (Line 11011) Line 11011 corresponds to line 0 in ScriptInfo.
It usually comes up when rolling for initiative
1764821698
timmaugh
Forum Champion
API Scripter
We're looking to use the first number that comes up in your error: Is that number consistent from each time you generate the error to the next? If it changes each time, let us know. But if it stays the same, use that in the ScriptInfo command line. There are very few native-Roll20-things that are exposed to the api sandbox and which are also JSON... but the Turn Order information is one of them, so it makes sense that this would happen when you were doing something with initiative. What is the state of the Turn Order when you get this error? Empty, or not? What do you do to trigger the error? Is there a difference if you do it with an empty Turn Order versus one that has an entry already in it?
It does it most commonly with an empty turn order, but does happen at other times also. I will check out when it happens the other times and let you know.