Cannot use 'in' operator to search for 'status' in undefined at Scheduler._currentTask

URL of experiment: https://run.pavlovia.org/oztel/temporal_reproduction/html

Description of the problem: hello! I am trying to pilot test my experiment. However, I keep having the error depicted below: Cannot use ‘in’ operator to search for ‘status’ in undefined at Scheduler._currentTask

The code is as below also:

var thisComponent = {};

for (const thisComponent of instructionComponents)
  if ('status' in thisComponent)
    thisComponent.status = PsychoJS.Status.NOT_STARTED;

return Scheduler.Event.NEXT;

};
}

I thinj the problem is because somehow the “thisComponent” variable is not an object, but its a string. But I really dont know how to make it an object in a proper way, because it has many different attributions other than ‘status’ down in the code.

Can you please help me? :frowning:

thanks in advance -t

What does you pre auto translated Python code look like? I’m wondering whether the issue is with const

looks like this:

instructionComponents = [instructions, skip_instruction]
for thisComponent in instructionComponents:
thisComponent.tStart = None
thisComponent.tStop = None
thisComponent.tStartRefresh = None
thisComponent.tStopRefresh = None
if hasattr(thisComponent, ‘status’):
thisComponent.status = NOT_STARTED

this is where “thisComponent” is first mentioned in the py code

Hi! I’m having the same problem. I think it might be because I’m using a variable to set the start time. Here is the screen shot of the error:

After some more piloting, I realized it’s doing this when I have several timed objects. For example, if I make 1 dot appear for a short period of time before disappearing, it works. But if I try to make two dots flash one after the other, then it gives me the error above. Any ideas on how to fix this?