TypeError: undefined is not an object (evaluating 'this._trialSequence[this.thisRepN][this.thisTrialN]')

Hi! Could anyone help to handle this error, please? The problem is not clear for me


Unfortunately, I haven’t found related issue in Crib sheet. PsychoPy Python to Javascript crib sheet 2021 - Google Docs

Here is the flow of the experiment if it is helpful

Thank you in advance!

Does this happen immediately when you start up the experiment or at some specific point in the experiment?

Can you share the Pavlovia repository?

The basic issue is that something in your experiment isn’t being initialized properly, but it’s not clear what or why from the error alone.

Hi Jonathan,

it happens immediately after instructions screen and pressing spacebar to move on to the training loop.
Here is the repository: Sign in · GitLab

Thank you for paying attention to my question!

It’s as scope issue with the custom variables you define at the start of the experiment, they can’t be accessed correctly in the rest of the experiment at the moment. Fortunately it’s fixable: Take all of the content of the code elements in the “initial_settings” routine and put them in the “Before Experiment” tab instead of the “begin experiment” tab.

You will likely get other errors having to do with some color names not being recognized, but this will solve most of the problems.

I’m so grateful for your help!
Could you also point out how to solve colors problem, please? I tried to change units to 8bit Rgb, use names instead of colors codes, remove complex colors like [1, 0.2941, (- 1)], but nothing has helped.

If anyone was looking for solution, border color of our polygons was empty (=“undefined”), which produced the undefined named color

2 Likes