Error syncing from builder

OS (e.g. Win10): macOSCatalina (but I have also tried using windows and get the same errors)
PsychoPy version (e.g. 1.84.x): 2020.2.4
Standard Standalone? (y/n) yes
What are you trying to achieve?: sync experiment from builder to psychopy. For details, my project seems like it should be straightforward. All of the necessary files have a total size of 161 MB. I built everything using point and click in builder, no coding. I use 3 CSV files for random presentation of stimuli within loops. There are only 112 total trials plus a few practice trials. I am definitley logged into pavlovia via builder, which was a troubleshoot noted on another post.

What did you try to make it work?: Run the study online button; sync button; clicking file>export html; clicking “pavlovia.org” in menu > new; creating a new project in pavlovia on the web and manually pushing files to it using commands; run in local debug mode
(I suspect there is an issue with the builder script getting converted to JS, but I don’t know what the specific issue is or how to fix it.

I saw this post Existing Pavlovia experiment not syncing from PsychoPy builder about clearing the cache, but I’m not sure how to do that and currently worry my coding ineptitude I might wipe something important off my computer if I keep poking around… :grimacing:

In my effort to isolate the coding issues (an having no idea what I’m doing), I created a “code component” just so I could use the auto > JS feature; when I paste the full code from the PsychoPy coder window into the auto area, it says /* Syntax Error: Fix Python code */

I figured out the JS converts if I delete everything after the following code; but I think i’m just poking around in the dark now.


if thisPracticeloop != None:
    for paramName in thisPracticeloop:
        exec('{} = thisPracticeloop[paramName]'.format(paramName))

for thisPracticeloop in practiceloop:
    currentLoop = practiceloop
    # abbreviate parameter names if possible (e.g. rgb = thisPracticeloop.rgb)
    if thisPracticeloop != None:
        for paramName in thisPracticeloop:
            exec('{} = thisPracticeloop[paramName]'.format(paramName))

What specifically went wrong when you tried that?:

  1. Run the study online button: prompted to create new project on Pavlovia; then opened commiting changes dialogue; then spinning wheel of doom, program becomes non-responsive and I have to force-quit. A new project IS created on pavlovia, but the gitlab repository is empty.

  2. using sync button: spinning wheel of doom, program becomes non-responsive and I have to force-quit.

  3. clicking file>export html: I get the following error in the runner:

26.8424     EXP     Imported /Users/naomi/Documents/SourceFiles/Order_Encode.csv as conditions, 225 conditions, 2 params
1628.0390     ERROR     Line 205: Unexpected token , in T1Task.js
1628.1100     EXP     Imported /Users/naomi/Documents/SourceFiles/Order_PracticeEncode.csv as conditions, 3 conditions, 2 params
1628.1221     EXP     Imported /Users/naomi/Documents/SourceFiles/Order_Encode.csv as conditions, 225 conditions, 2 params
1628.1439     EXP     Imported /Users/naomi/Documents/SourceFiles/Order_Encode.csv as conditions, 225 conditions, 2 params
1628.7392     EXP     Imported /Users/naomi/Documents/SourceFiles/Order_PracticeEncode.csv as conditions, 3 conditions, 2 params
1628.7498     EXP     Imported /Users/naomi/Documents/SourceFiles/Order_Encode.csv as conditions, 225 conditions, 2 params
1628.7676     EXP     Imported /Users/naomi/Documents/SourceFiles/Order_Encode.csv as conditions, 225 conditions, 2 params
1629.6761     ERROR     Line 195: Unexpected token , in T1Task-legacy-browsers.js
  1. pavlovia.org” button > new: I get this error
Traceback (most recent call last):
  File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/pavlovia_ui/project.py”, line 161, in submitChanges
AttributeError: ‘NoneType’ object has no attribute ‘project’

I say “ok” to that dialogue; then opened comitting changes dialogue; then spinning wheel of doom, program becomes non-responsive and I have to force-quit. A new project IS created on pavlovia, but the gitlab repository is empty.

  1. creating a new project in pavlovia and manually pushing using commands; I have ZERO experience with this; was able to do once using a youtube tutorial, but it ran into an error, and now I can’t even get it to start the process-- some of my current errors are below:
  • List item fatal: remote old-origin already exists.

  • List item error: ‘20201008_758/’ does not have a commit checked out

  1. pilot locally in debug mode: opened my browser with a white page that said “initializing experiment…”, but it got hung up there.

There are definitely more things I’ve tried, but I can’t recall them now.

*Note, that at some point, one of the strategies (not sure which) DID push the files to the remote repository. It is here: https://gitlab.pavlovia.org/naowright/disst1252 (I tried to make it public, hopefully that worked.)

Note that, since then, I found a forum post that indicated my issue might be that I was using .xls files to list stimuli files; since then I converted those to .csv and changed the corresponding bits in builder. It’s possible that when I made that change, things stopped pushing altogether? I didn’t realize anything was getting pushed until long after they had been pushed because the builder would always crash and I assumed nothing had worked. There are also a lot of extra unnecessary files/folders that got pushed, that you will see in the repository. I’m not sure why that happened either.

Thank you for any assistance you can provide. If it helps for motivation, this is my dissertation project, and I am learning a lot through whatever help you can give. :ok_hand: :ok_hand:t3:

Thanks,
Naomi

EDIT: After posting, I created a super simple new project with only one picture and a mouse click to end the task. THIS PROJECT CREATED THE SAME PROBLEMS! Of note, the project is in a parent folder that includes all of the files I would need for the full task, so perhaps that is the issue. I will go make a simple trial version in a folder with only one picture in it and report back!

EDIT #2: Just tried an even simpler version, with one image, a mouse click to end the task, and only the image file and psychopy file in the folder. This version successfully synced to pavlovia AND I was able to pilot it. At least I’ve proved I am not insane, but I definitely don’t know how to fix the issue with the desired task. My next plan is to slowly re-build a new version of the task and test the sync at each stage to find where the issues start. This is probably poor forum etiquette, but it feel like a fun adventure I’m on…

Update: I started re-building from scratch and syncing at every tiny step to see when the issue starts. It looks like the issue is connected to a loop based on a CSV file. I am able to get PsychoPy to push to gitlab/pavlovia and the experiment runs in Psychopy. However, when piloting from Pavlovia and running in local debug mode, it shows the first few simple routines, and then ends the experiment early at the point it should start the loop derived from the CSV file. Any thoughts?

SOLUTION: As others have indicated, this appears to be an issue with the python code translating to javascript. I had a friend who is much better than me at coding review my code and found that I had put in a blank text component and that was the issue. I went in and put a space in the text field of that component and everything worked!

Glad you found a solution! The blank text component problem is a known issue which there is a fix for in 2020.2.5, so in future this problem shouldn’t occur.