Type error: not a function - half way through experiment on Pavlovia

You could try copying the essential project files to a clean folder and try to create it as a new project.