TypeError: resourceName.spilt is not a function

URL of experiment:

Description of the problem:
Hey everyone, I was running a demo online but encountered the following issue.

In the developer tool console it showed:

My experiment includes two tasks. In the first task participants view six sequences of six images and make judgement on duration of the sequence. In the second task, participants’ memory for previously watched sequences will be tested. For now, the experiment was able to show instructions for the first task, but when it comes to presenting the sequences, I got the error above (sometimes the error appeared after one sequence had been presented). I’ve checked my JS script and don’t think I have .split function in the beginning of sequence presentation. Can anyone give me a hint on how to debug?

Thanks so much!

p.s. I do have codes (JS code below) at the beginning of the sequence presentation to select rows to make sure images are shown in sequence but I’m not sure if it will cause the issue.

// Begin experiment
study_prac_trial_counter = 0;
study_prac_row_indices = [0, 1, 2, 3, 4, 5];
study_prac_row_number = 0;
study_prac_row_start = 0;
study_prac_row_end = 0;

// Begin routine
study_prac_row_number = study_prac_row_indices[study_prac_trial_counter];
study_prac_row_start = (study_prac_row_number * 6);
study_prac_row_end = (study_prac_row_start + 6);
study_prac_row_selected = ((study_prac_row_start.toString() + ":") + study_prac_row_end.toString());
1 Like

@Becca Hi Becca–Do you have a change to see if you have any insight into this issue? This stuck with me for a week…Many thanks in advance.

Hi There,

Do you have the phrase “.split” anywhere in your conditions file or code components? Looks like it is trying to apply the split function to something but can’t


Hi Becca–thanks for getting back to me!
That’s what confuses me. I carefully checked all my code components and condition files but cannot find “.split” anywhere. Any idea where else I should check? I don’t quite understand why it says this error occurred “when importing condition: NaN”. Seems it points to problem in condition files?

Use print('study_prac_row_selected',study_prac_row_selected) to find out whether the correct rows are being addressed.

Hi Wake thanks for your help. I think correct rows are selected but let me double check: for “Selected rows” in the Psychopy GUI we should define selected rows as “first row to (last row+1)” right? At least this is what works for me for my previous studies and locally.

Correct so long as you know that the first row (of the data, so the second row of the spreadsheet) is row 0

Exactly thank you! And any idea on what other things might cause this error?

Does it fail on a particular row choice?

Try adding one more row to your spreadsheet.

I figured out! I have an inner and an outer loop to control rows selected. What I did previously was that I had a conds file for the outer loop which contains only the conds file’s name of the inner loop. Yet I now realize I should leave the conds file for the outer loop blank and only set conds file for the inner loop!