| Reference | Downloads | Github

Unspecified JavaScript Error please help

URL of experiment: socialanxietydiss [PsychoPy]

Description of the problem: Had so many issues trying to run my Psychopy builder experiment through Pavlovia - posting a new thread as I completely rebuilt it on Psychopy making sure to organise all my resources and simplify it as much as possible (as the last build was my first time ever using Psychopy) and I’m still getting unspecified JavaScript error.

I have attached the two error messages that I’m getting.

Any help is so appreciated, this is for my undergraduate dissertation and I don’t know what I’ll do if I can’t run this research.

When you start the experiment do you see it downloading the resources? If not, then try adding them via the online tab of experiment settings.

@wakecarter Tried it and got the same issue, although there are now these four further warnings.

I noticed that you have a lot of very similar routines and no loops.

One this you could do is change all of your allowed keys from ‘space’ to [‘space’] to remove that error, but it’s very difficult to debug. You could put the image names in an Excel/csv file and replace generalisation 0-5 with a single routine (or 0-4 and then keep 5 separate because of the sound file).

What data are you collecting? Without a loop or any code components I think your reaction times for pressing space to repeats of the same routine will replace the previous instance.

@wakecarter It is a fear conditioning/stimulus generalisation task. In the conditioning routine, they are taught to associate 100fear.png image with the unpleasant sound file. Then, the generalisation routines are designed to show them each of the other four images as well as the conditioned image and give them the opportunity to press spacebar to avoid that sound by ending the routine.

The data I am interested in is for what images they choose to press spacebar for, in order for me to see if they have learned to associate the sound with the other, similar, images or if they have just learned the fear/avoidance response to the 100fear.png image. The sound file is with generalisation 5 only as that is the only one they genuinely HAVE to avoid, the others would show they had learned an unnecessary fear response - if that makes sense.

I didn’t realise that repeating the same routine would cause that issue? As I said it’s my first time using any software like this and due to COVID I am not in my university and working completely remotely, so struggling with navigating it all.

@wakecarter I have done some fiddling and research and amended my research so that the experiment uses trial loops instead of repeats (thank you for the suggestion) - obviously still having same issue when I launch online unfortunately

From my crib sheet

Use Stop durations

Sounds should either be edited to correct length or use sound.stop() in a code component.

Try removing all of the durations from your sound components I’d be very interested to learn whether that removed your unspecified JavaScript error.

@wakecarter update - I ran the experiment in Firefox and Safari and it ran perfectly. Still having the same issue with Chrome and Microsoft Edge but will try what you suggested. If the sound file is 3 seconds shall I just leave it as infinite duration?

Correct. If the sound is the correct length it shouldn’t need a duration.

@wakecarter sorry, no luck. Doesn’t seem to be compatible with Chrome or Edge for some reason?

I’ve just noticed that you have blanktext with nothing in it. Add a space.

That normally gives a different error rather than unspecified.

Are you using Ctrl-Shift-R to clear the cache to make sure you’re running the most recent version?

@wakecarter unfortunately no luck. Could it be to do with my sound files being .wav?

Wav should only fail in IE but I do recommend mp3.

How about disabling all of the sound components to see if they are the source of the error?

What I do for sound online is set up the sounds in a component that never plays and then play and stop them in code.

There may be issues with trying to play the same sound in different components.

@wakecarter disabled sound components and had the same issue. Posted a separate thread just in case anyone else has had the same issue specific to browser compatibility but any other ideas here I am willing to try!