# Unfortunately we encountered the following error: Unspecified JavaScript error

**URL:** <https://discourse.psychopy.org/t/unfortunately-we-encountered-the-following-error-unspecified-javascript-error/16808>\
**Category:** Online experiments\
**Created:** [September 26, 2020, 3:07pm UTC](https://discourse.psychopy.org/t/unfortunately-we-encountered-the-following-error-unspecified-javascript-error/16808 "2020-09-26T15:07:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vishnukant\_Tripathi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/vishnukant_tripathi/32/10811_2.png) [@Vishnukant\_Tripathi](https://discourse.psychopy.org/u/Vishnukant_Tripathi)\
**Post date:** [September 26, 2020, 3:07pm UTC](https://discourse.psychopy.org/t/unfortunately-we-encountered-the-following-error-unspecified-javascript-error/16808/1 "2020-09-26T15:07:11Z")

</div>

URL of experiment: [https://pavlovia.org/run/vkt/ert](https://pavlovia.org/run/vkt/ert)

Description of the problem:  
My experiment is running well in the builder, but when I am running it online at [pavlovia.org](http://pavlovia.org) it is giving me following error:

```auto
Unfortunately we encountered the following error:

* **Unspecified JavaScript error**

Try to run the experiment again. If the error persists, contact the experiment designer.

```

I have checked my browsers console for further detail on error. The browser shows following error

```auto
log4javascript.min.js:1 WARN unknown | setting the value of attribute: size in PsychObject: instruction as: undefined

log4javascript.min.js:1 WARN unknown | setting the value of attribute: size in PsychObject: Fixation as: undefined

log4javascript.min.js:1 WARN unknown | setting the image of ImageStim: stimulus_faces with argument: undefined.

log4javascript.min.js:1 WARN unknown | setting the value of attribute: image in PsychObject: 
log4javascript.min.js:1 WARN unknown | setting the mask of ImageStim: stimulus_faces with argument: undefined.

log4javascript.min.js:1 WARN unknown | setting the value of attribute: mask in PsychObject: stimulus_faces as: undefined

log4javascript.min.js:1 WARN unknown | setting the value of attribute: labelHeight in 
log4javascript.min.js:1 WARN unknown | setting the value of attribute: rating in PsychObject: Slider_Angry as: undefined

log4javascript.min.js:1 FATAL unknown | null

```

After seeing this error I read the forum and tried the solutions given there, such as creating new condition file but I am still having same issue.

Can anybody please guide me how to solve this issue?

---

<div class="post-metadata">

**Author:** ![CCMorey](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/ccmorey/32/46422_2.png) [@CCMorey](https://discourse.psychopy.org/u/CCMorey)\
**Post date:** [October 22, 2020, 12:28pm UTC](https://discourse.psychopy.org/t/unfortunately-we-encountered-the-following-error-unspecified-javascript-error/16808/2 "2020-10-22T12:28:09Z")

</div>

I’m having exactly the same problem, on a protocol that had been working shortly before. I was making minor changes to text and testing it on multiple browsers when I suddenly start seeing errors like this. Would be very keen to hear thoughts on this.

Update:  
In case it helps solve the other problem, here is a link to my study: [https://pavlovia.org/run/CCMorey/ps1018\_practical2/html/](https://pavlovia.org/run/CCMorey/ps1018_practical2/html/)

And my repo:

> **[Candice Morey / PS1018\_practical2](https://gitlab.pavlovia.org/CCMorey/ps1018_practical2)**
>
> This practical demonstration is for the use of students completing the PS1018 module. This demonstration supports practical 2.

From the console, it seemed like the problem was that the js script was not inheriting the sizes from the Builder settings. I went through and changed all options to “norm” explicitly, but the js still thinks the sizes are undefined. I’ve confirmed that now the objects are specified as using norm units in the js script as well as in Builder.

---

<div class="post-metadata">

**Author:** ![CCMorey](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/ccmorey/32/46422_2.png) [@CCMorey](https://discourse.psychopy.org/u/CCMorey)\
**Post date:** [October 23, 2020, 1:26pm UTC](https://discourse.psychopy.org/t/unfortunately-we-encountered-the-following-error-unspecified-javascript-error/16808/3 "2020-10-23T13:26:14Z")

</div>

In case it is any help, I’ve managed to fix my problem. I was juggling two issues, one to do with converting a snippet of code to conditionally exit a loop, and this javascript undefined attribute thing. My script had worked in an old build of PsychoPy (ported to Pavlovia) back in July but when updated to the newest version, the conditional code no longer worked. But if I back-tracked to the older version, I got the undefined attribute error.

I gave up trying to solve the undefined attribute error, returned to the newest version of PsychoPy, and wrote my conditional loop exit in a different way that would be acknowledged in javascript (basic fix was to make my own counter rather than rely on thisN or thisTrialN).
