"split" error when running study via Pavlovia

Description of the problem: I’ve made a simple primed lexical decision task, which chooses one of three lists (at random) each time the study is run. Everything seems to be running offline without issue, but when it comes time to run online, the following error appears when trying to generate one of the lists:

TypeError: Cannot read property ‘split’ of undefined

I have made sure that all of the lists are properly uploaded online and when the experiment starts, it says that all resources have been properly uploaded. I have uploaded the code here as well! In the code, path1 is what is given as the path to the conditions files, generated at the beginning of the experiment. I have four blocks, each with a trial object., and each accessing the same conditions file, with the selected rows given a variable (rows1-rows4) which refers to a slice containing the start and end indices of the rows to be used in each trial block.

Any help would be appreciated. Thank you in advance :slight_smile:


Hi

Please could you search for split in your js file as uploaded to Pavlovia?

Have you had success with imports? They don’t normally work. Slice may also work differently in Pavlovia.

Please search the forum for a link to my crib sheet

Hi, I’ve searched for split in the js file and there is nothing there. I’ve also tried removing the imports and the same issue is occurring.

Sorry, can you clarify what a crib sheet is? I’m unfamiliar with the term.

Replying here because I’m getting the same error with a project including only a Form component:
TypeError: Cannot read properties of undefined (reading 'split')

There is no “split” in the compiled/uploaded JS and the PsychoPy project literally only has one Form component in it (linked with one formItems.xlsx).

Any ideas anyone?

Forms need to point to csv files not Excel files. That might be the issue. Does it work offline?

Thanks for responding. And I wish it was that simple! I used the built-in csv template for the Forms component and it works as expected offline.

Hello gabrielle

look here for the crib sheet:

Why do you use slice? Isn’t

rows1 = str(0) + ":" + str(nrows/4)
rows2 = str(nrows/4) + ":" + str(nrows/2)
...

working? That code should translate to PsychoJS. I assume that you use rows1 to rows4 to select rows from an Excel-file.

Best wishes Jens