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

[Lazy Experience] Firebase issue?

(linked thread in script is closed so I am creating new thread) From last session I am getting error when trying to "add extra experience" to one character - getting mostly this error  For reference, the error message generated was:  TypeError: Cannot read property 'characters' of undefined TypeError: Cannot read property 'characters' of undefined at setExperience (apiscript.js:23319:53) at handleInput (apiscript.js:23171:29) 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 /home/node/d20-api-server/api.js:1662: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) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Zd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) This wasnt happening before - was trying to reset config/reinstall script but without much success - any idea how to fix this or how is this caused? Thanks
1610741827
The Aaron
Roll20 Production Team
API Scripter
So, I can't say what the actual error is, but here's where it's probably crashing: state[state_name].players[playerid].characters.forEach((character, i) =>{ The issue is that there is no entry in .players for that particular playerid.  That probably means that player has no characters it controls, or some configuration that needs to happen didn't.  I'd need to look into it in more detail later, but maybe that will help you find a solution in the documentation or config.
Hmmm - I have seven players in my campaign - five are active with all assigned characters - and it has been working before :-/  There might be one "buggy" character might try to remove it if it will solve the issue - but when I distribute session XP it will correctly add xp to all characters - its failing only while trying to add personal xp to characters. weird
Now I am sometimes getting this spam "TypeError: value.trim is not a function at Function.sanitizeXP (dnd5e.js:61:36) at Object.eval [as -MN_UxPTCJBQBObC9s5R//false//0.5300377107903194] (dnd5e.js:3817:42) at _fullfillAttrReq (evalmachine.<anonymous>:688:31) at messageHandler (evalmachine.<anonymous>:721:6) at process.<anonymous> (/home/node/d20-api-server/node_modules/tiny-worker/lib/worker.js:65:55) at process.emit (events.js:314:20) at emit (internal/child_process.js:877:12) at processTicksAndRejections (internal/process/task_queues.js:85:21)" "TypeError: value.trim is not a function" "TypeError: value.trim is not a function at Function.sanitizeXP (dnd5e.js:61:36) at Object.eval [as -MQVrzBi--19vKvSWPpM//false//0.36904048570184433] (dnd5e.js:3817:42) at _fullfillAttrReq (evalmachine.<anonymous>:688:31) at messageHandler (evalmachine.<anonymous>:721:6) at process.<anonymous> (/home/node/d20-api-server/node_modules/tiny-worker/lib/worker.js:65:55) at process.emit (events.js:314:20) at emit (internal/child_process.js:877:12) at processTicksAndRejections (internal/process/task_queues.js:85:21)" "TypeError: value.trim is not a function" "TypeError: value.trim is not a function at Function.sanitizeXP (dnd5e.js:61:36) at Object.eval [as -MN9RpqnTfAgZZctQHwP//false//0.22686527848846016] (dnd5e.js:3817:42) at _fullfillAttrReq (evalmachine.<anonymous>:688:31) at messageHandler (evalmachine.<anonymous>:721:6) at process.<anonymous> (/home/node/d20-api-server/node_modules/tiny-worker/lib/worker.js:65:55) at process.emit (events.js:314:20) at emit (internal/child_process.js:877:12) at processTicksAndRejections (internal/process/task_queues.js:85:21)" "TypeError: value.trim is not a function" "TypeError: value.trim is not a function at Function.sanitizeXP (dnd5e.js:61:36) at Object.eval [as -MNUHGNJrCdlZePhkQep//false//0.5477911123716968] (dnd5e.js:3817:42) at _fullfillAttrReq (evalmachine.<anonymous>:688:31) at messageHandler (evalmachine.<anonymous>:721:6) at process.<anonymous> (/home/node/d20-api-server/node_modules/tiny-worker/lib/worker.js:65:55) at process.emit (events.js:314:20) at emit (internal/child_process.js:877:12) at processTicksAndRejections (internal/process/task_queues.js:85:21)"