URL of experiment: Pavlovia
Description of the problem:
I have created a single file combining three different projects/evaluations. Each project works individually locally and on Pavlovia. When I combine the files using “copy routine” the new file works locally but not on Pavlovia.
It runs through the first two sections then I get an “unable to convert NaN to a number” error which I have read is related to improperly initialized variable. I have no idea how to debug on Pavlovia so I can’t figure out which variable is the problem or if that is the problem at all. The fact that it works locally makes me think it is a js problem but I’m new to Pavlovia.
Any help is appreciated.
If the combined experiment works offline then have a look at our troubleshooting guide.
https://psychopy.org/online/psychoJSCodingDebugging.html
Specifically, here, you need to check the browser console to identify what variable is NaN. The easiest way to initialise a variable is to put variableName = 0 in Begin Experiment. However, this may not be the issue here since that normally solves a variable not defined error.
Thank you for the guidance. I have captured the error in this snip
but don’t understand how to interpret it. I see one line in my js referencing GUI.dialog but it seems like it is structure related to the functioning of the overall experiment, not specifically related to the part that consistently fails
psychoJS.scheduleCondition(function() { return (psychoJS.gui.dialogComponent.button === ‘OK’); }, flowScheduler, dialogCancelScheduler);
1 Like
We have spotted precisely the same issue/error code cropping up in a recent study of ours - but only when running the experiment on certain machines. We can’t figure out why either!
If you have found a fix for this, would be great to hear it.
Daniel
Hi Daniel,
I did get mine working but I had help and I’m not 100% certain that I understand all of the changes that were made. The changes were made in the javascript. What I do know was done was
- Changed to version to 2022.2.4 (there are at least 2 references in the javascript)
- Changed to avg to util.avg . I think this would apply to multiple math functions
- Defined a variable before assigning it a value: Added “var threshold;”
I hope these will give you some guidance in your debugging. Please let me know if it works for you.