# Pavlovia TypeError: Cannot read properties of undefined (reading 'Keyboard')

**URL:** <https://discourse.psychopy.org/t/pavlovia-typeerror-cannot-read-properties-of-undefined-reading-keyboard/28999>\
**Category:** Online experiments\
**Tags:** pavlovia\
**Created:** [May 4, 2022, 7:48pm UTC](https://discourse.psychopy.org/t/pavlovia-typeerror-cannot-read-properties-of-undefined-reading-keyboard/28999 "2022-05-04T19:48:04Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Cait-M](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@Cait-M](https://discourse.psychopy.org/u/Cait-M)\
**Post date:** [May 4, 2022, 8:47pm UTC](https://discourse.psychopy.org/t/pavlovia-typeerror-cannot-read-properties-of-undefined-reading-keyboard/28999/7 "2022-05-04T20:47:27Z")

</div>

I gotta be honest, I have no clue anymore.  
I know it was from a post like this: [How to play and repeat stimuli after a manual click](https://discourse.psychopy.org/t/how-to-play-and-repeat-stimuli-after-manual-click/4845/13) , but it had that `var code` and `var sound` in front of it, but I can’t seem to find said post anymore.  
Or rather, this was how it originally was in python:

```auto
import psychopy.core as core
import psychopy.sound as sound

def playSound():
    testaudio = sound.Sound('testaudio.wav', secs = 1)
    testaudio.setVolume(1)
    testaudio.play()
    core.wait(.3)

```

and this is what it became in JS:

```auto
import * as core from 'psychopy/core';
import * as sound from 'psychopy/sound';
function playSound() {
    var testaudio;
    testaudio = new sound.Sound("testaudio.wav", {"secs": 1});
    testaudio.setVolume(1);
    testaudio.play();
    core.wait(0.3);
}

```

which caused trouble because of the asterisks, and so I ended up with the `var core` that you see now (with some help from a friend who knows a little more than me)

I’ve honestly been considering just throwing the audio testing routine out and get my participants to check their audio another way, because I keep suspecting this routine is the cause of all my woes.

---

_[View the full topic](https://discourse.psychopy.org/t/pavlovia-typeerror-cannot-read-properties-of-undefined-reading-keyboard/28999)._
