psychopy.org | Reference | Downloads | Github

Pavlovia - Cannot read Property 1 Error

URL of experiment: https://run.pavlovia.org/merve73/soa_lastedition/html

code: https://gitlab.pavlovia.org/merve73/soa_lastedition/edit/master/html/Soa_original.js

Description of the problem: Hi, I do not know why but I get this error after a couple of trials. Although the trials are always in the same structure with only changing stimulus type, this error does not appear in the first trials but then appears. And another change between trials is a condition that may be satisfied after a couple of trials which I assume that the error is related. I do not know what this error refers to but it gives an error related to this line of my code:

if (walking_stickman.status === PsychoJS.Status.STARTED && Boolean(((pressed && (t > (pressTime + delay))) || (automatic && (t > (tStart + a[compsound])))))) {
walking_stickman.setAutoDraw(false);
}

(automatic && (t > (tStart + a[compsound]) condition may be satisfied after a couple of trials and this line can be checked after that. That is why I am thinking the error is related to that part of the line.
Do you have any idea regarding what this error refers to? What should I check?
Thank you all in advance.

I solved the problem, in case anyone faces the same issue the reason was defining the variable two times with ‘var’ in different places in the code.