Error message in pavlovia: ReferenceError: instClock is not defined

Description of the problem:

When I try to perform an inline experiment through Pavlovia, it returns an error message although the experiment run perfectly fine on my computer:

ReferenceError: instClock is not defined

So I thought maybe I have to add this var in the JS code of the experiment in line 421 after var instComponents;
but it didn’t help. I guess I’m acting incorrectly somehow.

var t;
var frameN;
var continueRoutine;
var _key_resp_allKeys;
var instComponents; instClock;
function instRoutineBegin(snapshot) {
return async function () {
TrialHandler.fromSnapshot(snapshot); // ensure that .thisN vals are up to date

//--- Prepare to start Routine 'inst' ---
t = 0;
instClock.reset(); // clock
frameN = -1;
continueRoutine = true; // until we're told otherwise
// update component parameters for each repeat
psychoJS.experiment.addData('inst.started', globalClock.getTime());
key_resp.keys = undefined;
key_resp.rt = undefined;
_key_resp_allKeys = [];
// keep track of which components have finished
instComponents = [];

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


In principle don’t edit the JS code directly.

Is instClock a variable in your experiment?

Where do you use it first?

If it’s a clock then put instClock = core.Clock() in Begin Experiment and then instClock.reset() when you want to reset it.