Builder Pavlovia sync not working

Hi all,

I build an experiment in the PsychoPy builder that is running locally.
I have watched the YouTube tutorial to upload it to Pavlovia, but I get an error whenever I try to sync it.

I already tried these things:

  • restart PC and Psychopy
  • put only the task and related conditions and pictures in a new folder do have everything clean from old stuff.
  • I re-installed PsychoPy
  • I am logged in on Pavlovia through an open browser, but also from within the builder

This is the error message I get:

Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 1344, in onPavloviaSync
self.fileExport(htmlPath=htmlPath)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 793, in fileExport
target=“PsychoJS”)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 74, in generateScript
compileScript(infile=exp, version=None, outfile=filename)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 247, in compileScript
_makeTarget(thisExp, outfile, targetOutput)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 219, in _makeTarget
script = thisExp.writeScript(outfile, target=targetOutput, modular=True)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 289, in writeScript
self_copy.flow.writeLoopHandlerJS(script, modular)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\flow.py”, line 345, in writeLoopHandlerJS
entry.writeMainCodeJS(script, modular) # will either be function trialsBegin() or trialsEnd()
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\loops.py”, line 662, in writeMainCodeJS
self.loop.writeLoopStartCodeJS(buff, modular)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\loops.py”, line 231, in writeLoopStartCodeJS
seed=seed))
TypeError: str returned non-string (type NoneType)

Hello Jennifer,

if I understand the error message correctly there seems to a type problem (str returned a non-string …) What is in line 231?

Best wishes Jens

Hi Jens,

If I am compiling the Phyton script is have this line f cose which does not seem related to the error as far as I see: color=[1,1,1], colorSpace=‘rgb’, opacity=None,

If I am clicking on the compile JS script button, I get this error again, so apparently there is something going wrong here. I made the whole task with the builder because I do not know Python and only added some short code components based on examples I have found online, e.g., counterbalancing groups based on participant number.

Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 793, in fileExport
target=“PsychoJS”)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 74, in generateScript
compileScript(infile=exp, version=None, outfile=filename)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 247, in compileScript
_makeTarget(thisExp, outfile, targetOutput)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 219, in _makeTarget
script = thisExp.writeScript(outfile, target=targetOutput, modular=True)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 289, in writeScript
self_copy.flow.writeLoopHandlerJS(script, modular)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\flow.py”, line 345, in writeLoopHandlerJS
entry.writeMainCodeJS(script, modular) # will either be function trialsBegin() or trialsEnd()
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\loops.py”, line 662, in writeMainCodeJS
self.loop.writeLoopStartCodeJS(buff, modular)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\loops.py”, line 231, in writeLoopStartCodeJS
seed=seed))
TypeError: str returned non-string (type NoneType)

Hello Jennifer,

since the program runs locally but not online, you might want to take a look here

Search for color. The approach on page 17 should help you…

Best wishes Jens