Troubles in exporting psychopy exp. on pavlovia

Hello everyone,
I am encountering some troubles in exporting my experiment in Pavlovia. It is a quite complex experimental procedure, which works perfecty via Psychopy, but then it gives me the following error if I try to generate the link for the online pilot in Pavlovia. Can anyone please help me in this regard?
Thanks a lot :slight_smile:

Best

Gianvito

ERROR DISPLAYED:

Traceback (most recent call last):
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\builder.py", line 1240, in onPavloviaRun
    self.fileExport(htmlPath=self._getHtmlPath(self.filename))
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\builder.py", line 719, in fileExport
    target="PsychoJS")
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py", line 73, in generateScript
    compileScript(infile=exp, version=None, outfile=filename)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py", line 242, in compileScript
    _makeTarget(thisExp, outfile, targetOutput)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py", line 214, in _makeTarget
    script = thisExp.writeScript(outfile, target=targetOutput, modular=True)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\_experiment.py", line 256, in writeScript
    self_copy.flow.writeLoopHandlerJS(script, modular)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\flow.py", line 325, in writeLoopHandlerJS
    entry.writeMainCodeJS(script, modular)  # will either be function trialsBegin() or trialsEnd()
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\loops.py", line 610, in writeMainCodeJS
    self.loop.writeLoopStartCodeJS(buff, modular)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\loops.py", line 197, in writeLoopStartCodeJS
    self.params['Selected rows'])
TypeError: __str__ returned non-string (type NoneType)

ONLINEbeta.psyexp (2.5 MB)

Hey Gianvito,

I reproduced your issue and I suspect it has something to do with loops (given the error message mentions loops all the time). Now, your experiment has quite a lot of those, so it’s a bit hard to pinpoint which one is giving you problems. I can recommend a debug-strategy though: systematically remove parts (i.e. loops) from your experiment, until you can export to HTML. This gives us an idea as to what loop caused the error.

Cheers T

Hi Thomas,
thanks a lot for the answer. I will follow your thoughtful suggestion. Indeed the experiment has quite lots of loops as I am trying to merge a whole experiment into a single file. Anyway, many thanks for your help.
Best wishes,

Gianvito

1 Like