Unfortunately we encountered the following error: Unspecified JavaScript error

URL of experiment: 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 it is giving me following error:

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

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?

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/

And my repo:

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.

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).

1 Like