Cannot run an old OSWeb experiment online with the v2.1
Hi!
I have been trying to make a few small changes to an otherwise functioning online experiment I created with an older version of the OSWeb a couple of years ago. However, now, when I try to use the same program, I get errors. One of which was related to the use of "let" in the inlines to define some variables prior to changing them later in the script (i.e., reassigning some values). When I did this, I got the error message that this variables were already defines. So I removed or changed the "let" to "var" instead, both worked for the first loop in which I used them. However, the second loop which had the same structure and variables but was an unlinked copy failed. I now get the following error when it comes to this loop:
"Uncaught TypeError: Cannot read properties of null (reading 'includes')
This error occurred in the run phase of item AGmouse_response"
I cannot figure out what might be the problem. Any ideas or suggestions?
Thank you!

Comments
Hi @SelinT ,
In JavaScript, you can declare a variable only once using
var,let, orconst. That's part of JavaScript syntax.In OSWeb 1, each
inline_javascriptitem was executed in an empty workspace, which meant that you could declare variables multiple times, and this wouldn't cause a problem because the workspace would be empty each time anyway. But since OSWeb 2, the workspace is preserved, and you therefore now get this error message. That's the background.The easiest workaround is to simply remove
let,var, andconstaltogether because in the non-strict JavaScript mode that OSWeb uses you can simply assign directly to a variable without declaring it first, like you wold in Python:— Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!