Error: False is not defined

URL of experiment: SocPRODPsychoPyBOYS_OrderA_ROBOT [PsychoPy]

Description of the problem:

Hello there! I’m getting an error that says “ReferenceError: False is not defined” when I try to run my experiment in Pavlovia. Opening up the browser console, it points to the line sound_14.setVolume(1, log=False). This seems to be something that PsychoPy generates automatically when it makes the .js file, as I didn’t write that. It looks like the problem is that it’s trying to use “False” with a capital F, whereas booleans in JS seem to be lowercase. I’ve tried adding a code block to the PsychoPy builder that just says var False = new Boolean(false); in an attempt to trick it into behaving properly, but that didn’t work. Any ideas? I’m stumped.


Interesting. I am not a JavaScript programmer, so I may be on the wrong track. But it looks like your False definition is defined inside a function and is therefore not available outside the function. Have you tried putting your definition in the Begin experiment tab? Currently it seems to be in a Begin routine tab.

Best wishes Jens

Can you please show us the code that is causing the issue? The full scope.


That mostly seemed to work! It then gave me a “log is not defined error”, so what I ended up doing is just going through the js file (I know, generally not advised) and changing all the instances of setVolume(1, log=False) to just setVolume(1). That finally let me run my experiment. New errors to sort through now, but that seems to be fixed. Thanks!