psychopy.org | Reference | Downloads | Github

Unspecified JavaScript error & error closing session

URL of experiment: (but it is in piloting mode, don’t know if you can still view the code…)
https://run.pavlovia.org/Rika/masterarbeitsstudie_bevi_2021/html/

Description of the problem:
When I run the experiemnt on some devises, I get an error when trying to end the experiment. At the end, the orange dialog box appears and is followed directly by an error message saying it had problems closing the sessions. The data file (csv) can then still be viewed directly in the browser, but I cannot download the result from the pavlovia server afterwards (it returns an empty zip folder, despite there being some complete data files – meaning, one faulty file seems to crash the whole folder).

I noticed, that this happens when I use an ipad (Mac Intel). The error appears regardless of which browser I use. I tried Safari, Firefox OS and Chrome OS.

I addition, on Firefox OS and Chrome OS (only when using the iPad!) I get the error message: Unspecified Javascript error) right at the beginning of the experiement before the first routine starts.

I tried to follow the advise in @wakecarter Crip sheet (PsychoPy Python to Javascript crib sheet - Google Docs)
and edited the index.html file but nothing changes.

When running the experiment on my windows laptop on Chrome everything works perfectly. Even on my Android based tablet on Chrome it works fine.
Further information: I used PsychoPy Version 2020.2.4 (Builder) for programming.

Can anyone please help me?

Hey! I’ve got two suggestions:

  1. Upgrade to the newest PsychoPy; could be that any issue causing this has already been fixed by more recent versions.
  2. To get a better idea of where it’s going wrong, take a peek at the browser console. See this tutorial: tutorial_js_semantic_error [PsychoPy]

Thank you for your quick reply!!
I tried your suggestion and upgraded psychopy to the newest version (2021.1.2), but it still shows an error when closing the session on the ipad. I even created a new project so that the changes in the psychopy version were definitely implemented, just to be an the safe side. Also changed line 21 in the index.html file.

Problem with the console.log messages are, that I don’t know what the actual problem is or on which line the bug occurs. So I don’t know, where I should put the console.log line. And I cannot access the Webdeveloper tools on any of the iPad browsers (Safari, Firefox, Chrome) to find out where the bug is. I would need a Mac to be able to get access to it (and I don’t have one).

Super strange thing. Even stranger that this error does not show up on my windows laptop or tablet.

In addition, I cannot download any results from the pavlovia server anymore. Still returns an empty zip folder.

Ah yeah of course, that goes much harder on iOS than on Android. Let me ask around a bit and get back to you.

1 Like

We’re having some trouble accessing your experiment; did you happen to deactivate it?

ah yes, so sorry! Forgot to paste the new link here after creating a new project.
Here it is (still in piloting mode though)

https://run.pavlovia.org/Rika/masterarbeitsstudie_bevi_2021/html/

I recruited a skilled and well-equipped programmer. Could you share your repo on gitlab with thewhodidthis? I’ll also tag him here: @sotiri

Okay great, thanks! I added him as a member with guest permission. :slight_smile:
@sotiri Or do you need another role permission?

Thanks @Rika, could you make it developer access please? As guest I have no access to the actual code :nerd_face:

1 Like

He’ll need at least Developer

Done :slight_smile:

Hi @Rika, thanks for giving me access to the repo. Sorry, I have no clear answer for you today. The error you are getting is session related, but I see nothing in the code that would point to it being iPad / iOS specific. I need to check with our Pavlovia engineer whether the logs contain any clues as to what the problem is. I can tell there is a bit of custom data adding in your project, would it be possible to send me a minimal working example to run more tests with? Thanks, x

Oh wow, okay. Didn’t think this would be so strange and hard to solve. Thank you for your help! Much appreciated!!
I compiled a minimal working example as best as possible. Should be in the repo, too. It’s called
“PsychoPy_BeVi2021_MA-Studie MinimalWorkingExample”.
Is there anything else I can add or help you with?

@sotiri Just wanted to ask if there are any news or updates yet?
I kind of need to start collecting data soon and I am wondering, if there is anything I can do to help solve the issue?

Hi @Rika, apologies for the late response :blush: Thanks for taking the time to produce a slimmer version of your project for me to look at. It seems to be getting stuck always at the last trial on the iPad for some reason (can provide screen recordings). Maybe that’s a hint as to what is wrong here :thinking: I need to be able to reproduce the problem before I know how to fix it. It might take some more trial and error, but I’ll get there in the end! Sorry, x

Thank you for all your work and effort! Really appreciated! :slight_smile: :blush:
Yeah, that is the same error I get when I use the iPad too. On some iPad browsers (e.g. Firefox OS) I get another error message right at the beginning of the experiment though, so I thought: Maybe there is some issue with closing the session, because I removed the “particiant” field from the Experiment Info Dialog box? Could that cause problems? :thinking:

Were you able to find a solution yet? :innocent:

Hi @Rika, no worries at all, keine Sorge! Apologies for the delay :blush: Yes and no, in that I was able to go through the whole study on iPad Safari a few times with no problems. As it turns out, I just had to switch to landscape mode. The polygonWeiter graphic was being cut off the screen is all it was :man_facepalming:

OK dropping the participant field should be no issue. However, because transmitting the data back to Pavlovia once the project is run can take a few seconds, I wonder if this is just a case of the participant being eager to finish up?

But I’m curious about the Firefox error you’ve encountered as well, would it be possible to send me the details for that, e.g., any browser console logs or screenshots? Thanks, x

Hi @sotiri! No problem, thanks for still being on this :slight_smile: Yeah landscape mode is necessary, should have mentioned it, sorry :smiley: So you could go through the experiment from beginning to end on an iPad without problem? The dialog box with the green heading showed up and there was no error message at all? Maybe the problem is then with my iPad and not an overall iPad problem at all… :thinking:

I don’t think the errors occurs because the session is closed to fastly by me/ the participant. The closing session error occurs once I click on the last polygonWeiter button and then the dialog info appears with the orange heading. The heading never turns to green though, instead the error message (picture 1) appears directly followed by a table of the results in the browser tab (picture 2):
picture 1:

picture 2:

The firefox error occurs directly after initialising the experiment in the Firefox OS browser (again, only on my iPad). Right before and right after the info dialog box appears, an error message shows up. The first disappears directly on its own and is followed by the info dialog box (see the very short video clip and ignore the background noise please :grin:). Once I enter all the informations and click on “continue”, the error message appears again, but this time it stays until I click on “ok” and then I can just continue to go through the experiment as normal (picture 3).


picture 3:

Since I don’t have access to any developer tools on the iPad, I cannot see what exactly the problem is.

Hi @Rika, oh I see, alright, massive thanks for all the information, that helps tons! OK the “blob:” bit in the address bar is telling me that instead of posting the data back to the server, the browser is trying to display the results inline, interesting! But it looks Firefox specific as does the “boot time” error you have documented. Alright, let me run a few more tests, thanks again for your patience and debugging cooperation, more soon, x

1 Like

Hi @Rika, OK this was a bit of a pain to debug, because Firefox offers no developer tools on iOS, apologies again for the delay. As it happens, the problem is with the log4javascript.js library that PsychoJS relies on under the hood for logging, the getLogger() method in particular. One would have hoped that upgrading to the latest version might automagically take care of things, but it looks like there is something specific about iOS Firefox that is making it trip :-1:

Unfortunately, because of how tightly coupled PsychoJS and Pavlovia are with log4javascript, it would be impossible to address the issue without a major refactor :roll_eyes: I completely respect how privacy concerns might make iOS Firefox a great choice for everyday use, but in terms of running your study is there any harm instructing your participants to avoid it? According to Wikipedia it only seems to cover between 0.31 and 0.70% of the market across all mobile devices! We may at some point consider making changes to our logging system, but I have no idea how soon, x

1 Like