"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

Running into this error again with a different experiment/project that also uses the form component. Anyone got any ideas?

Please can you share with us the csv you are using for your form component?

Thanks!
Becca

cheeseForm.csv (682 Bytes)
formItems.csv (554 Bytes)
Consent.xlsx (9.1 KB)

Here are a few that it has happened with (but run fine locally via PsychoPy).

Thanks.

Update,

So the error seems to be to do with specific items, e.g. in the cheeseForm this adding and removing this line introduces and removes the error message.

That seems to be to do specifically with there being no ticks or tick options for those values.

Unfortunately that doesn’t resolve the formatting issues - but I think for the split error it might be that you need tick values?