Absolutely cannot figure out bug: When converting an object to its numerical form - unable to convert undefined to a number (Minimal Pavlovia experiment)

URL of experiment: minimal [PsychoPy]

Code for the experiment: tlab / MinimalSliderTest · GitLab

Description of the problem:
Whenever I try to run the experiment, I receive the error message

when converting an object to its numerical form
unable to convert undefined to a number
Try to run the experiment again. If the error persists, contact the experiment designer.

I’ve tried ensuring no variables anywhere are left undefined, paring back the experiment to its minimal components, everything I can think of to get it to work in some minimal version, but I still see the bug each time.
I think it might have something to do with the sliders? That being said, I’ve disabled collecting any data from them and I still see the bug.

For what it’s worth, the experiment works just fine in its Python version locally on my computer.

I’ve seen two previous versions of this issue here and here, but their problems don’t seem to apply here.

I think the issue is with this bit of code in your code component:

    circle_fill = [0, green_val, 0];
    Circle_G.setColor(circle_fill, {"colorSpace": "rgb255"});
    Circle_R.setColor([1, 0, 0], {"colorSpace": "rgb1"});
    Circle_G.size = [size_val, size_val];
    Circle_R.size = [size_val, size_val];
    green_val = 10;
    size_val = 0.3;

You need to define green_val before you use it as a green value in your circle fill color. Currently its being passed as undefined.

facepalm

Yes, that’s fixed it. Thanks for your help!

@dvbridges @jon

Similar problem while I try to run my experiment in pavlovia:
image

URL of the experiment: Pavlovia
Gitlab code: Surabhi D Lodha / Flaker · GitLab

It was running fine until yesterday. I did not change anything in the code. Please helo me debug this issue.

If the code sometimes works and sometimes doesn’t, it might be a blank row in your spreadsheet. Use the developer console in your browser to identify which line is giving the error.

@wakecarter

This is what the error says. But, I am unable to understand.

I just had a look at your psyexp file and your screen_info code component appears to have JS code pasted into the Python side of an Auto code component instead of as a JS code component. it therefore won’t be showing up online.