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 .
×
Create a free account

SyntaxError: Unexpected end of JSON input

So, no idea what happened, just started getting this...

SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at handleTurnOrderChange (apiscript.js:4766:28) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:154:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:154:1), <anonymous>:70:8) at TrackedObj.set (/home/node/d20-api-server/api.js:1034:14) at updateLocalCache (/home/node/d20-api-server/api.js:1332:18) at /home/node/d20-api-server/api.js:1622: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 clues? I hadn't even touched the API stuff this morning.

Any help or advice is greatly appreciated :D

May 12 (5 years ago)
GiGs
Pro
Sheet Author
API Scripter

Two possibilities come to mind:

They announced downtime for maintenance, maybe your API got scrambled. Restarting the sandbox might fix, but I guess you tried that.

The scripts in the one-click update around now, so maybe there;s a change in one of your scripts that is breaking things.

From the error report, it looks like its a script that is involved in the turn timer, so try disabling any such scripts and see if things work. Once you have found the script thats an issue, we (most likely Aaron, hehe) can try to figure out what is causing it to break. 

Yeah, I had a bit of a play disabling and enabling turn related API's. It's very likely my fault and not a problem with the scripts.

I've currently got : Turnmaker, TrackerJacker and Combat Tracker.

Need to narrow it down to the one prefer and disable the rest probably.

Thanks for the help CiGs, appreciate it.

May 12 (5 years ago)
The Aaron
Roll20 Production Team
API Scripter

It's probably an interaction between TurnMarker1 and Combat Tracker.  TurnMarker1 was my first script and isn't the best code... =D  IIRC, Combat Tracker resets the Turn Order to '' instead of '[]'.  '' is the default that games start with, but pretty much everything (like clearing the turn order) resets it to '[]', so TurnMarker1 assumes it will always be valid JSON (whoops).  If it isn't, you get the error above.  The annoying thing is, invalid JSON used to be a silent error, but an upgrade to the API sandbox a few years ago made it an exception that brings down the API.

I've pushed an updated version that fixes that crash in TurnMarker1 here: https://github.com/shdwjk/Roll20API/blob/master/TurnMarker1/TurnMarker1.js


Thanks a lot guys, appreciate the time you made to comeback to me on this.

Cheers

May 12 (5 years ago)
The Aaron
Roll20 Production Team
API Scripter

No problem!