psychopy.org | Reference | Downloads | Github

Unspecified JavaScript error: works in some computers but not others

URL of experiment: https://run.pavlovia.org/cmfo/exp4-generation-task-with-audio-instructions/

Description of the problem: I only have a bit of code in this experiment, so I am a bit confused as to why this is not working as I have used this psychopy task in previous experiments but now it gives an error. Did anything change with JS?
The only bit of code is this one:

pressed_key = Guess_inclusion.keys[0]

if pressed_key == ‘z’:
x = -0.650
elif pressed_key == ‘x’:
x = -0.215
elif pressed_key == ‘n’:
x = 0.215
elif pressed_key == ‘m’:
x = 0.650

Smileyface.pos = [x, 0]

Used another computer and it works in this one. I am not sure why that would be given that I am using google chrome in both. I had this problem before, where this experiment did not work for some people. Could someone let me know what is the problem?
I am using Chrome’s Version 87.0.4280.88 on both.
Thank you

Can you describe the error in more detail?
What error message do you get?

Exactly what I mentioned, it only says:

Error

Unfortunately we encountered the following error:

  • Unspecified JavaScript error

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

Hi @cat500, sounds like a WebGL incompatibility error. Is the support fork running as expected on your browser? Would it be possible to give me developer access so I can create a merge request to bring the relevant edit into your project? Here to help, s.

Hi @cat500, just to mention that I am currently having the same issue. I have an experiment running which works fine on my own PC, but one participant is reporting the same ‘Unspecified JavaScript error’.

Hey @Katy_Vdb, could you send me a link to your study or the relevant thread please, sorry if I missed it? Thanks, x

I’ve just had a report of an unspecified JavaScript error on Chrome but not Firefox by a student for whom I’m creating https://run.pavlovia.org/Wake/visual-search/

I use Chrome and it’s working for me.

We are all using chrome and it still doesn’t work on some computers. This has happened quite frequently for me before and made me lose a lot of data.

@sotiri, yes, the support fork works normally on the computer where it wasn’t working before. How can I give you developer access? Is there anything I can do to prevent this from happening?

Hi @cat500, OK thanks for confirming, the following page details project member settings,

Because the change required is tiny and code component based, you could also download the following .psyexp to replace your existing one,

Hi @sotiri, sorry for my late answer, but here it is: https://gitlab.pavlovia.org/katrivdn/prim_sec_affect_study1 (hopefully you can access it!). I just asked the participant to try it on another browser, and she didn’t reply to me back; so I don’t know whether this worked. I also just saw that 2 credits were consumed, so the experiment had to be able to run at least on some PCs. I myself didn’t encounter any problem when doing some piloting, and it previously worked well. Thanks for your help!

Dear @sotiri, I cannot seem to be able to download the file, it just asks me to sign in. How can I access the file?

Could you please let me know why this error happens? Is something missing from my code? I want to be able to avoid it in the future if possible.

Thank you for this ticket! I had the same problem, it worked on my PC but unspecified error on laptop. On my colleage’s PC it worked, too…it happened after I updated PsychoPy…

Hi @Katy_Vdb, no problem, I have added a potential fix, could you check if the support fork runs OK on the affected browsers? Thanks, s.

1 Like

Hi @cat500,

OK I gave you developer access to the support fork and you should be able to browse the repository now. The problem is that on some browsers on some computers the WebGL-only rendering that PsychoJS relies on by default is unavailable.

The fix is to manually edit ‘index.html’ to bring in the ‘pixi.js-legacy’ package. In particular, one needs to replace line 21 to read:

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/pixi.js-legacy@5.3.3/dist/pixi-legacy.min.js"></script>

Please let me know if you need more support, x

3 Likes

Should we always had this just in case it doesn’t work? What I need to do is copy the “index.html” file and add it to my project?

Yes exactly, copy the support fork ‘index.html’ into your project and re-sync, but again like you say make sure to keep the correct ‘index.html’ in place if you make changes in PsychoPy, x

Seems to run smoothly! Thanks @sotiri!!

@sotiri hi, I know this is an old thread. But I am having the same issue and just came across this thread. My experiment URL is socialanxietydiss [PsychoPy]

and my gitlab is Ellie Bloxham / socialanxietydissertation · GitLab

My experiment runs smoothly on Firefox and Safari but I get Unspecific JavaScript error on Chrome. Do you have any idea how to fix this?