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?

I’ve been dealing with the same issue- the same routine operates perfectly in isolation or even at the beginning of a long set of routines- but when placed after other routines i get the following error

index-size-error.ts:727 TypeError: Cannot use ‘in’ operator to search for ‘status’ in 2

in js component it corresponds to this line

for (const thisComponent of instructions_actionsComponents) if ('status' in thisComponent) thisComponent.status = PsychoJS.Status.NOT_STARTED; return Scheduler.Event.NEXT; } }

curious if you have any thoughts about this.

Thanks for all of your help with psychopy!