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

easy experience wont launch

I get this message whenever I run the script: TypeError: Cannot read property 'id' of undefined TypeError: Cannot read property 'id' of undefined at apiscript.js:567:51 at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9) at _.chain.filterObjs.reduce.map._.chain.filterObjs.reduce.map.outputConfig (apiscript.js:566:11) at _.chain.filterObjs.reduce.map._.chain.filterObjs.reduce.map.HandleInput (apiscript.js:687:29) at eval (eval at (/home/node/d20-api-server/api.js:143:34), :65:16) at Object.publish (eval at (/home/node/d20-api-server/api.js:143:34), :70:8) at /home/node/d20-api-server/api.js:1393:12 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) I was really enjoying the script and have tried disabling, uninstalling, running alone and nothing
1475414219

Edited 1475414315
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hi Wyzad, I apologize for the inconvenience. Could you check a few things for me? Have you added any new characters lately? Do all your characters have a populated experience attribute, even if it is 0 (that you typed in)? Do you have any non-numeric characters in any experience field? What command causes the error? Could you post the error that you get when running it by itself; this will help me find the exact line of code that is disliking the input. I'll be able to hop on for troubleshooting later today if none of those work.
1. Yes I have added and deleted characters lately. 2. Yes all player characters have at least a 0 for their current experience. 3. No no numeric numbers in experience fields. 4. !xp session, !xp config, and !xp reset causes the error. 5. When running the API alone this is the error; Spinning up new sandbox... "-=> EasyExperience v0.1.01 <=- [Sat Jun 11 2016 15:06:11 GMT+0000 (UTC)]" TypeError: Cannot read property 'id' of undefined TypeError: Cannot read property 'id' of undefined at apiscript.js:431:55 at Function._.map._.collect (/home/node/d20-api-server/node_modules/underscore/underscore.js:172:24) at _.chain.filterObjs.reduce.map._.chain.filterObjs.reduce.map.applyXP (apiscript.js:430:27) at _.chain.filterObjs.reduce.map._.chain.filterObjs.reduce.map.HandleInput (apiscript.js:693:29) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:143:34), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:143:34), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1393:12 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)
1475418289
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Thank you for that Wyzad, it'll really help the troubleshooting process. One last question, did you copy paste the script or are you using the one-click install? And what version are you using if you copy and pasted?
one click install
copy pasted came up with; "-=> EasyExperience v0.1.01 <=- [Sat Jun 11 2016 15:06:11 GMT+0000 (UTC)]" TypeError: Cannot read property 'id' of undefined TypeError: Cannot read property 'id' of undefined at apiscript.js:567:51 at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9) at _.chain.filterObjs.reduce.map._.chain.filterObjs.reduce.map.outputConfig (apiscript.js:566:11) at _.chain.filterObjs.reduce.map._.chain.filterObjs.reduce.map.HandleInput (apiscript.js:687:29) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:143:34), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:143:34), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1393:12 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)
I found a work around. If I create a copy of the game all seems to work fine. Im just going to add the other scripts and further test.
1475419683
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ah, this sounds like it's a problem with a corruption of the state that I've seen before. Could you try the reset command that I added in with v1.03 (!xp reset)?
!xp reset caused the same error
1475420091
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hmm, ok, I'm gonna have to do some troubleshooting once I'm back home this afternoon then.
I did find that work around, just a bit of a pain having to re input and setup all the scripts. Ill be around to help if needed
1475461429
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ok Wyzad, I've finally had some time to look at the code now that I'm back home with my laptop. It looks like somehow the script is not loading any information into the state for the PCs. I'm pretty sure that this is the state corruption that I put !xp reset in to handle (although I could never test it since I was never able to replicate the issue). I could see !xp reset not working at all to reset the state, no idea why it crashes your sandbox though. Could you post/PM me the error that you get when you try !xp reset , as I'm unsure how this error could cause a crash there.
here is the message "-=> EasyExperience v0.1.01 <=- [Sat Jun 11 2016 15:06:11 GMT+0000 (UTC)]" TypeError: Cannot read property 'id' of undefined TypeError: Cannot read property 'id' of undefined at apiscript.js:567:51 at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9) at _.chain.filterObjs.reduce.map._.chain.filterObjs.reduce.map.outputConfig (apiscript.js:566:11) at _.chain.filterObjs.reduce.map._.chain.filterObjs.reduce.map.HandleInput (apiscript.js:684:29) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:143:34), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:143:34), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1393:12 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)
1475496005
The Aaron
Pro
API Scripter
Line 567 is where the crash appears to be happening.  If you add this, it should prevent the crash and also log some clues about what is happening:         _.each(PCs,function(obj){ if(!_.has(obj,'id')){ log('outputConfig()::Bad Object:'); log(obj); return; }             if(state.EASYEXPERIENCE.config.PCs[obj.id].playing === 'active'){
1475497558
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yep, pretty much what I was gonna say. Wyzad, I think I'm gonna have to manually debug this since it's an issue i can't replicate in my games. Could you pm me an invite and I'll poke around to see what happens.
i sent you a link, once you have accepted ill gm you
promoted
1475517214

Edited 1475517243
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
For anyone who is having this issue, I have found the error that occurs. I do have a version of the script that can reset the error and am working on some modifications to make the script more stable. If you need the version that resets the script's memory before I'm done with the rewrite, please PM me. Thanks to Wyzad for letting me use his game as a guinea pig.
Hey Scott, just ran into the exact same problem, any update on those mods?
1476292962
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Are you using the new  v1.1 ? I haven't gotten it merged for one click yet.
lemme give it a whirl
Worked! Your the man, thank you!
1476293373

Edited 1476293402
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Good to know and glad to hear.