Cannot sync psychopy builder with Pavlovia

Description of the problem:

I have programmed my experiment using psychopy builder. When I try to sync it with Pavlovia I get the following error:
Traceback (most recent call last):
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\”, line 1221, in onPavloviaSync
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\”, line 719, in fileExport
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\”, line 73, in generateScript
compileScript(infile=exp, version=None, outfile=filename)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\”, line 242, in compileScript
_makeTarget(thisExp, outfile, targetOutput)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\”, line 214, in _makeTarget
script = thisExp.writeScript(outfile, target=targetOutput, modular=True)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\”, line 251, in writeScript
self_copy._currentRoutine.writeRoutineBeginCodeJS(script, modular)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\”, line 277, in writeRoutineBeginCodeJS
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\”, line 202, in writeRoutineStartCodeJS
self.writeParamUpdatesJS(buff, ‘set every repeat’)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\”, line 405, in writeParamUpdatesJS
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\”, line 399, in writeParamUpdates
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\experiment\”, line 435, in writeParamUpdate
valStr = str(val).strip()
TypeError: str returned non-string (type NoneType)

Could someone please help me with the problem?
Thank you!

I encounter the same problem as well. Could you solve the problem? I appreciate the help a lot.

I updated PsychoPy version and it gave the same error but this time specified it.
In Psychopy, while referring a code in a component, we use . We should only put one at the beginning. My mistake was using it twice as $testlist2[countertest2] to call the word from the list. However, the second created the problem. The problem is fixed when I deleted it as $testlist2[countertest2].

Hope it will help others in need!