
Hi, I was creating a custom sheet and ran into a problem. I checked the code line by line and realized that it was caused by a radio button.
Creating a new session room using a custom sheet, and write the following code in the html part.
<fieldset> <input type="radio" name="attr_something" value="0" checked >0 <input type="radio" name="attr_something" value="1" >1 <input type="radio" name="attr_something" value="2" >2 <input type="radio" name="attr_something" value="3" >3 </fieldset>
Go to the Mods(API) script and write the following code.
log("test");
Save Script, Restart API Sandbox, open a new window and enter the game room, I get the following error in Mods page.
TypeError: Cannot read properties of undefined (reading 'split')
TypeError: Cannot read properties of undefined (reading 'split')
at getAttrName (/home/node/d20-api-server/charsheet.js:119:53)
at Object.<anonymous> (/home/node/d20-api-server/charsheet.js:140:27)
at exports.each (/home/node/d20-api-server/node_modules/cheerio/lib/api/traversing.js:300:24)
at getAvailableAttributes (/home/node/d20-api-server/charsheet.js:138:39)
at /home/node/d20-api-server/charsheet.js:365:45
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
In the console
"test" "Loading character sheet data..." TypeError: Cannot read properties of undefined (reading 'split') TypeError: Cannot read properties of undefined (reading 'split') at getAttrName (/home/node/d20-api-server/charsheet.js:119:53) at Object.<anonymous> (/home/node/d20-api-server/charsheet.js:140:27) at exports.each (/home/node/d20-api-server/node_modules/cheerio/lib/api/traversing.js:300:24) at getAvailableAttributes (/home/node/d20-api-server/charsheet.js:138:39) at /home/node/d20-api-server/charsheet.js:365:45 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) "test" "Loading character sheet data..." TypeError: Cannot read properties of undefined (reading 'split') TypeError: Cannot read properties of undefined (reading 'split') at getAttrName (/home/node/d20-api-server/charsheet.js:119:53) at Object.<anonymous> (/home/node/d20-api-server/charsheet.js:140:27) at exports.each (/home/node/d20-api-server/node_modules/cheerio/lib/api/traversing.js:300:24) at getAvailableAttributes (/home/node/d20-api-server/charsheet.js:138:39) at /home/node/d20-api-server/charsheet.js:365:45 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
All scripts will not work because of this error. The error seems to occur when the Character sheet is loaded. because the message "Starting webworker script" appears in the console when the character sheet is successfully loaded.
As you can see, it's very basic code. I don't know why I'm getting this error. Can you help me? Thanks.