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

Pesky Unknown Error Killing the Sandbox

I love this forum, and I love learning Javascript and making Scripts for the API in my SWN campaign, but lately this error keeps coming up. I don't know from where, or why. I've tried the Inspector Script to find it, but I cannot seem to make it work either. It's always the same error too. HELP! I've shut off scripts one by one to narrow it down, but I think it might be roll20AM script itself. I've got quite a lot of sounds. Maybe 100? Only half are in playlists. I'm also using setInterval and setTimeout on 2 scripts (used to flip multi-sided tokens as a slldeshow for Session End Credits), but i'm careful to clear those out, and set them to null after exiting those 2 pages. The only reason I'm suspicious of those is the 1st 2 errors that come up) ERROR BELOW ____________________________________ 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:  TypeError: Cannot read properties of null (reading 'indexOf') TypeError: Cannot read properties of null (reading 'indexOf') at d20.textchat.doChatInput (eval at <anonymous> (/home/node/d20-api-server/api.js:172:1), <anonymous>:332:18) at sendChat (/home/node/d20-api-server/api.js:1920:16) at outputConfig (apiscript.js:334:16) at changeHandler (apiscript.js:751:21) 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:1107:14) at updateLocalCache (/home/node/d20-api-server/api.js:1442:18) at /home/node/d20-api-server/api.js:1656:7 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560
1720615629
timmaugh
Pro
API Scripter
That's not something for the Inspector script to diagnose... you want ScriptInfo for this. Install it and (assuming it doesn't slot in *before* scripts you already have installed -- I've seen that happen) run this command: !scriptinfo 1920 That's the first line number that might be a part of a script (from your error). The d20.textchat.doChatInput command (actually higher in the stack) is something native to Roll20, so it might be not at all related to your scripts... It could be something on Roll20, generally, or something in your particular game. Let us know what ScriptInfo says about this line. If it's between scripts, show us your mod deck with the installed/activated scripts.
this is the biggest script i have and one of a few that use  else if(msg.type=="api" && msg.content.indexOf("!Console")==0){ as a listener. the scriptinfo didnt return anything at all, but maybe i need to do that once the sandbox crashes... but that would kill scriptinfo as well i imagine
Script Information (Line 1920) That line number does not correspond to any script reporting its offset. It occurs 123 lines before the start of TokenMod.
1720669460
timmaugh
Pro
API Scripter
So that looks like it is coming from Roll20AM, but there is no sendChat counting back 123 lines from the end of the script. What sort of behavior triggers this error?
I havent done the best job of troubleshooting, but activating sounds seems to do it? Sometimes it might be switching pages? I need to nail that down. Sometimes it pops before I've done anything at all. -that might be key
1723347596

Edited 1723347620
GM
Pro
@timmaugh - I figured it out. It was a space at the end of a sound clip filename. It was killing roll20AM.
1723370467
GiGs
Pro
Sheet Author
API Scripter
Those pesky typos and syntax errors - one misplaced character is the bane of programmers!
Ive also found that if i have a sound file, delete it for whatever reason, and load a new one with the same name... i often get the same error from roll20AM