TypeError when routine is placed in middle of experiment but not in the beginning of an experiment

Url of experiment: part1_final [PsychoPy]

I have a routine titled mixed_2. This 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

* **TypeError: Cannot use 'in' operator to search for 'status' in 0**

in js component it corresponds to this line

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

Does anyone have any suggestions for how to deal with this?

thanks so much
LS

It looks like at some point in your experiment, a variable which should be a component has been overwritten with 0 - are there any points where you’ve said myComponentName = 0 rather than myComponentName.someAttribute = 0?

Thank you @TParsons TParsons. quite weirdly, by just recreating the routine with all the same components solved the issue