# Debug unspecified JavaScript error

**URL:** https://discourse.psychopy.org/t/debug-unspecified-javascript-error/15482
**Category:** Online experiments
**Created:** [August 4, 2020, 10:19pm UTC](https://discourse.psychopy.org/t/debug-unspecified-javascript-error/15482 "2020-08-04T22:19:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![HungShao](https://avatars.discourse-cdn.com/v4/letter/h/439d5e/32.png) [@HungShao](https://discourse.psychopy.org/u/HungShao)
#### Post date: [August 4, 2020, 10:19pm UTC](https://discourse.psychopy.org/t/debug-unspecified-javascript-error/15482/1 "2020-08-04T22:19:32Z")

</div>

Hi,

**URL of experiment:** [https://run.pavlovia.org/APPL/talker\_training/html](https://run.pavlovia.org/APPL/talker_training/html)

**Description of the problem:**  
The experiment can be run fine locally. However, when i tried to run it online, it gave me the error message: “Unspecified JavaScript error”. I am not sure what the error might be because I have tried to debug the experiment but none works. Overall, i have used the audio and image stimuli (including using a variable to define the opacity of the image) as well as mouse click as a response input.

**Description of the experiment**  
In my experiment, i have set up four images on the screen and a sound. Within each block the trial is repeated twice. And I have an outer loop that combines the four blocks and the whole loop runs twice. The image is shown here:

 ![Screen Shot 2020-08-04 at 6.02.31 PM](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/9/8/98185aeb78be90040c86aa55444d70a053ae767d.jpeg)

In the second phase, the same design is used. But, an accuracy feedback is provided to the participants based on their accuracy. I have added a Python code in order to calculate the accuracy. Here is the code:

 ![Screen Shot 2020-08-04 at 6.15.50 PM](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/4/3/43131f5492e4af95d2bc087e7e106e319553eddd.jpeg)  
Here is the flow: ![Screen Shot 2020-08-04 at 6.16.16 PM](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/0/d/0d664f8c0a771b9271029942eec8e264df5697c1.png)

I can’t figure out what the problem might be here that gives rise to the Unspecified error. I would greatly appreciate if anyone can let me know how to solve this.

Thanks!!!

---

<div class="post-metadata">

### Author: ![Mary\_Youk](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/mary_youk/32/9991_2.png) [@Mary\_Youk](https://discourse.psychopy.org/u/Mary_Youk)
#### Post date: [August 5, 2020, 7:53am UTC](https://discourse.psychopy.org/t/debug-unspecified-javascript-error/15482/2 "2020-08-05T07:53:24Z")

</div>

Hello!  
I had the same issue and just saw another thread solve it.  
If you’re using $sound to direct to your external data file, you’ll get the JavaScript error. You can either import each .wav file manually or just change ‘sound’ to something else and it should work.

---

<div class="post-metadata">

### Author: ![HungShao](https://avatars.discourse-cdn.com/v4/letter/h/439d5e/32.png) [@HungShao](https://discourse.psychopy.org/u/HungShao)
#### Post date: [August 5, 2020, 3:25pm UTC](https://discourse.psychopy.org/t/debug-unspecified-javascript-error/15482/3 "2020-08-05T15:25:53Z")

</div>

Thank you so much! This solves the problem.  
Best!
