Online experiment throws errors only for some users

URL of experiment: visual-search [PsychoPy]
Code repo: https:// gitlab

Description of the problem:
The experiment runs locally without problems. It also runs online for most users, but some report issues. I could not reproduce the problem myself, but I received some logs from a user that experienced it:

Operating system: MacOS Mojave 10.14.6
Browser: Chrome 87.0.4280.88
Even before displaying the info dialog where the resources are downloaded, the user is shown the dialog:

From the developer console:

Operating system: MacOS Mojave 10.14.6
Browser: Firefox
The user gets to download resources, but after pressing “OK” they get shown the same error dialog as above (unspecified javascript error).

Operating system: MacOS Mojave 10.14.6
Browser: Safari
The user gets to download resources, after pressing “OK” they can go through the first couple routines displaying text information, but then they get shown the dialog:

Unfortunately, we encountered the following error:
TypeError: undefined is not an object (evaluating 'loop_EasyToMedium.finished = true')
Tru to run the experiment again. If the error persists...

My debugging capabilities are limited since it works for me in all the popular browsers. Any pointers to how I could fix this? I found a post where some people reported the same issue: Pavlovia experiment throws unspecified javascript error - #6 by kerblooee, but no information on the source of the issue or possible fixes was found.

I noticed that the pixiJS entry that is shown for me after the “Open Window.” entry is not present in the above extract from the dev console where the issue occurred. However, this would not explain why in Safari you can go through the few first routines…

Let me know if any more information is needed.

Could you try currentLoop.finished true instead of loop_EasyToMedium.finished = true just in case it’s related to the custom name of the loop?

Yes, that fixed the issue, and Safari seems to work fine. However, the same unspecified JavaScript error is thrown for both Chrome and Firefox. Any pointers to how I could fix that?

You could try this

Changes to index.html may need to be redone after every sync (unless you edit the git ignore file)