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

New errors in API. could I please get some help? :)

This is the error I now get within 5 minutes of a combat starting: All of my scripts are from the Mod library. Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your script's code and click the "Save Script" button. We will then attempt to start running the scripts again. More info... If this script was installed from the Mod Library, you might find help in the Community API Forum. For reference, the error message generated was: SyntaxError: Unexpected end of JSON input SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at apiscript.js:8007:30 at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:70:8) at TrackedObj.set (/home/node/d20-api-server/api.js:1099:14) at updateLocalCache (/home/node/d20-api-server/api.js:1442:18) at /home/node/d20-api-server/api.js:1736: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)
All my players use the D&D 5e by roll20 character sheets. It is so frustrating with the API having to be reset manually every 5 mins, These are the Mods I have installed: Mod Library G Ammo G GroupCheck G Concentration G Aura/Tint HealthColors G Vector Math G StatusInfo G splitArgs G MatrixMath G Path Math G 5th Edition OGL by Roll20 Companion G Health Status Apply G HTML Builder G Status Tracker G WildHelpers G APIHeartBeat G CombatTracker G D&D 5E - WildShape G Character Sheet Utils G GroupInitiative G Marking Conditions G DeathTracker G ScriptInfo New Script
1676638264

Edited 1676638291
The Aaron
Roll20 Production Team
API Scripter
What do you get from: !scriptinfo 8007
MODERATOR: Script Information (Line 8007) That line number does not correspond to any script reporting its offset. It occurs 712 lines before the start of
APIHeartbeat
1676644852
The Aaron
Roll20 Production Team
API Scripter
At this point, you have to do some math.  You know it's before APIHeartbeat, so look at the length of WildHelpers.  It's 685 lines.  712-685=27, so it's about 27 lines from the bottom of Status Tracker.  If you look at Status Tracker, that falls right inside: // Handler for the turn order changing on('change:campaign:turnorder', function(current, prev) { currentTurnorder = JSON.parse(current.get('turnorder')); previousTurnorder = JSON.parse(prev.turnorder); StatusTracker.validateStatuses(currentTurnorder, previousTurnorder); currentTurn = currentTurnorder.shift() StatusTracker.nextTurn(currentTurn); }); There's your JSON.parse().  The issue is likely that either this is a new game, or a script reset the turnorder by setting it to "" instead of "{}".  I'll see about sending a patch for this later today, but you can safely restart the sandbox and continue playing.