# Unable to add working routines to existing experiment

OS : Win10
PsychoPy version: 2020.2.4 (but experiment uses 2020.1 through Experiment Settings), standard standalone version

What are you trying to achieve?:
Newly added text or slider components are prevented from compiling into a script. Sometimes Stdout provides trace, sometimes nothing at all. The issue occurs when dealing with newly added Text-components through the builder - images are fine, for example. I’ve tried reverting back to 2020.2.3 (which worked before), but to no avail. I will try 2020.1.3 soon.
Is anyone experiencing the same issue? What does “TypeError: Can’t represent a Param of type extendedStr” mean?

Here’s the error trace:

File "C:\Program Files\PsychoPy3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Program Files\PsychoPy3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py", line 250, in <module>
compileScript(args.infile, args.version, args.outfile)
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 221, in _makeTarget
script = thisExp.writeScript(outfile, target=targetOutput)
File "C:\Users\User\AppData\Roaming\psychopy3\versions\psychopy\experiment\_experiment.py", line 203, in writeScript
self_copy.flow.writeBody(script)
File "C:\Users\User\AppData\Roaming\psychopy3\versions\psychopy\experiment\flow.py", line 194, in writeBody
entry.writeInitCode(script)
File "C:\Users\User\AppData\Roaming\psychopy3\versions\psychopy\experiment\routine.py", line 115, in writeInitCode
thisCompon.writeInitCode(buff)
File "C:\Users\User\AppData\Roaming\psychopy3\versions\psychopy\experiment\components\text\__init__.py", line 120, in writeInitCode
buff.writeIndentedLines(code % inits)
File "C:\Users\User\AppData\Roaming\psychopy3\versions\psychopy\experiment\params.py", line 204, in __str__
self.valType)
TypeError: Can't represent a Param of type extendedStr
Welcome to PsychoPy3!
v2020.2.4
1118.7747     INFO     [HIDDEN]
1137.7633     WARNING     IPython failed as shell, using pyshell (IPython v0.12 can fail on wx)


Edit: I tried 2020.1.3, but no success either. Resetting my preferences has not helped either.

File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\coder\coder.py", line 1313, in __init__
wx._core.wxAssertionError: C++ assertion "Assert failure" failed at ..\..\src\aui\framemanager.cpp(1521) in wxAuiManager::LoadPaneInfo(): Bad Perspective String
108.4771     INFO     C:\Program Files\PsychoPy3\pythonw.exe -m psychopy.scripts.psyexpCompile


Edit2: It’s a compatibility issue. I can compile a script when I set my Experiment Settings to " " (blank) or “2020”, instead of “2020.1”. I hope I can still run it online.

You’re right that it’s a compatibility issue! extendedStr is a parameter type we added in 2020.2 for the Textbox (we also added it to the Text component), it essentially means that the input for the parameter is a multi-line text input field. As you said, setting your version to 2020.2 (either by setting it to blank or just 2020) is the fix for this.

This shouldn’t affect running online as this is just used when creating the dialog box for editing the component, which is a local thing.

Great, it’s solved then! I still wonder why going back to 2020.1.3 didn’t help, but hey, it’s working now

Going back to 2020.1.3 means that your old components will work but your new components won’t - as the newer components have an extendedStr parameter which didn’t exist before. Whereas 2020.2 is designed to be backwards-compatible - it’s easier for the new version to handle old parameters than for older versions to handle parameters which didn’t exist yet

I hope I can still run it online.

Unfortunately, I cannot run my experiment online. I get an Unspecified Javascript Error, exactly the same as I described in the first part of this post. It has to do with the function requestAnimationFrame. Removing requests for frame rate results in the same errors as reported in the added section of that post.
Going back to 2020.1.3 is now no longer an option either.