TypeError: Cannot read property ‘getKeys’ of undefined

URL of experiment: https://pavlovia.org/run/mc1585/intelligibility_single_word_participant2

Description of the problem:
I am in the final stages of designing my experiment [which entails listening to sound files and typing the words that are heard). It now successfully runs locally, in Builder, but when I attempt to run it online, I get the following error:

"Unfortunately we encountered the following error:

  • TypeError: Cannot read property ‘getKeys’ of undefined
    Try to run the experiment again. If the error persists, contact the experiment designer."

I am not sure what this error means - any advice would be very much appreciated!
Thank you!

Please check my crib sheet (pinned post in online) for how to define event in code_JS

Thank you! I will take a look.


I am working on developing a self-paced reading experiment. I want sentences to be presented in segment by segment fashion. However, I am having the same difficulty. I keep getting * TypeError: Cannot read properties of undefined (reading ‘getkeys’) message. I jumped through wakecarter’s crib sheet but I was not able to solve this problem.

I am new to PscyhoPy so I just followed what an expert embodied his experiment. I am doing pilot testings but I am stuck at this issue. It is quite urgent so I hope somebody to generously help me!

FYI, I attach my JS code here( for Each Frame).

//Listen for keys
thesekeys = psychoJS.EventManager.getkeys()

n = thesekeys.length
i = 0

//update stim on spacebar press
while (n > i){

    if (thesekeys[i] == "esc"){
    } else if (thesekeys[i] == "space"){
        psychoJS.experiment.addData("readingRT", clock.getTime())
        psychoJS.experiment.addData("sentPos", sentPos)
        psychoJS.experiment.addData("keypress", thesekeys[i])
        sentPos = sentence + 1
        if (sentPos == words.length){
            continueRoutine = false
        stimulus = words[sentPos]
        i = i + 1

.getkeys() should be .getKeys()

Oh thanks! I should’ve been more careful!

However, I mended it but this change seems not reflected when I do pilot testings. Therefore, the error message keeps coming up.

Running the latest version of your experiment

When you synchronise changes to your experiment, you may need to clear your browser cache to see those changes online (using Ctrl-F5, Ctrl-Shift-R or equivalent). If this does not work use an incognito browser tab. A participant will not need to do this, so long as they have not already tried a previous version of your experiment.