# Unspecified error with JavaScript - undefined size

**URL:** <https://discourse.psychopy.org/t/unspecified-error-with-javascript-undefined-size/18004>\
**Category:** Online experiments\
**Tags:** pavlovia\
**Created:** [November 10, 2020, 6:30pm UTC](https://discourse.psychopy.org/t/unspecified-error-with-javascript-undefined-size/18004 "2020-11-10T18:30:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruce\_Martins](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/bruce_martins/32/11231_2.png) [@Bruce\_Martins](https://discourse.psychopy.org/u/Bruce_Martins)\
**Post date:** [November 10, 2020, 6:30pm UTC](https://discourse.psychopy.org/t/unspecified-error-with-javascript-undefined-size/18004/1 "2020-11-10T18:30:45Z")

</div>

URL of experiment: [https://run.pavlovia.org/bruceewmesmo/go-no-go-task/](https://run.pavlovia.org/bruceewmesmo/go-no-go-task/)

Description of the problem: When i ran the experiment and i get an “Unspecified error with JavaScript” in the part where images and sounds should start.

Looking for origin of the problem i get those warnings and error:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/9/b/9b99b59e9ea24963b67a84cb775a761af26a97b8.png)

The warnings seems to be about some null or undefined values related to size of objects. But in the code the size was specified in pixels manually. I tried other units and the error persists.

```auto
atividade_treinoClock = new util.Clock();
  image_treino = new visual.ImageStim({
    win : psychoJS.window,
    name : 'image_treino', units : 'pix', 
    image : undefined, mask : undefined,
    ori : 0, pos : [0, 0], size : [400, 400],
    color : new util.Color([1, 1, 1]), opacity : 1,
    flipHoriz : false, flipVert : false,
    texRes : 128, interpolate : true, depth : 0.0 
  });

```

Thanks in advance for any help.

---

<div class="post-metadata">

**Author:** ![ewiemers](https://avatars.discourse-cdn.com/v4/letter/e/ecccb3/32.png) [@ewiemers](https://discourse.psychopy.org/u/ewiemers)\
**Post date:** [November 10, 2020, 10:53pm UTC](https://discourse.psychopy.org/t/unspecified-error-with-javascript-undefined-size/18004/2 "2020-11-10T22:53:45Z")

</div>

I recently had trouble with the same error. It is not related to the warnings above it (which are not critical, you can ignore them). My problem was trying to generate a sound component (as opposed to using a sound file) in line. Others have had the same “unspecified error” with things like a constant text object set to blank or the size of a text component set to a fraction with pixels as the units. Unfortunately, this error is very vague and will not point you to your specific problem, but there are many replies to these types of situations with solutions in the discourse.

Example threads:

> [@Stuck on Unspecified Javascript Error](https://discourse.psychopy.org/t/stuck-on-unspecified-javascript-error/16072):
>
> URL of experiment: [Pavlovia](https://pavlovia.org/reillykayser/ocd_vdac) Hi, I’ve created an experiment in Builder (Psychopy 2020.2.3) which is working fine locally in Python. I’m trying to get it ported to use on Pavlovia, and I’ve been able to fix a few different bugs using Wakefield’s crib sheet, but I’m now stuck on an Unspecified Javascript Error that I haven’t been able to resolve. The experiment is a fairly straightforward visual search task which gets repeated 6 times, first in a practice block and then in 5 testing blocks which…

> [@Keep getting "unspecified javascript error" (not the IAT!), sound issue?](https://discourse.psychopy.org/t/keep-getting-unspecified-javascript-error-not-the-iat-sound-issue/12185/7):
>
> Hi Bobby, Thank you very much! My apologies for not getting back to you earlier. This is already helpful. I will try to remove the mouse.isPressedIn() function. Maybe I can just work with the “clickable stimuli”. But that won’t solve the sound issue, I guess (assuming that that’s at least one cause of the error). Do you have any experience with sound problems in Pavlovia? Thank you again for your help, I really appreciate it!

Also, some of the things in this cribsheet by user wakecarter can cause these errors, look for any of these in your program:

> **[PsychoPy Python to Javascript crib sheet](https://docs.google.com/document/d/13jp0QAqQeFlYSjeZS0fDInvgaDzBXjGQNe4VNKbbNHQ/edit)**
>
> This Doc is private
