**ReferenceError: Can't find variable: currentLoop**

I was contacted by a person trying to do my experiment that it didn’t work. After solving the “experiment stuck on initialising” and “couldn’t download file” issues, I now run into this error message:

URL of experiment: Chromasthesia [PsychoPy]

Description of the problem:

Unfortunately we encountered the following error:

  • ReferenceError: Can’t find variable: currentLoop

The Safari Webdeveloper refers me to a “Scheduler.js”, with the faulty lines being within:

// run the next scheduled tasks until a scene render is requested:
const state = await self._runNextTasks();
if (state === Scheduler.Event.QUIT)

It highlights the middle one,

  	const state = await self._runNextTasks();

I do not know what to do. Please help,
thanks in advance,

Max

Do you have any loops? This post may help.

Hi,
I do have two loops in my experiment and I now added a third with 1 rep and no spreadsheet, like you suggested. That however did not solve the problem, nor the error.
Interestingly I found out that the experiment.js that they use differs in my browser from the one I have (and the one in gitlab). Additionally I found this error code:

ReferenceError: Can’t find variable: currentLoop

async function updateInfo() {
currentLoop = psychoJS.experiment; // right now there are no loops
expInfo[‘date’] = util.MonotonicClock.getDateStr(); // add a simple timestamp
expInfo[‘expName’] = expName;
expInfo[‘psychopyVersion’] = ‘2024.1.5’;
expInfo[‘OS’] = window.navigator.platform;

Don’t worry about an overarching loop if you already have loops

Have you ticked “is trials” in your liops?