Description of the problem: My experiment was running perfectly on PsychoPy, but when I transferred it to Pavlovia it got stuck on the ‘initializing experiment’ screen. Using the Developer Tool, I looked at the line of code that gave the error “Cannot read property ‘create’ of undefined”
The underlined line is line 1360:
isNative = usableCustomElements && info.create.length === 1;
I do not know JavaScript at all, so I wasn’t able to read and follow the code to fix this. I’m open to any and all suggestions.
I didn’t create a variable named info in python, but I think it was generated automatically when I translated to JavaScript.
I am not sure what it is or does, but this is how it was created if it helps:
var htmlClass = (function (info) {
// (C) Andrea Giammarchi - @WebReflection - MIT Style
var
catchClass = /^[A-Z]+[a-z]/,
filterBy = function (re) {
var arr = [], tag;
for (tag in register) {
if (re.test(tag)) arr.push(tag);
}
return arr;
},
The line of code the Developer Tool led me to is not on my main .js file. It is in something called document-register-element-node. I’m not sure I’m looking at the right place to fix my code. Any suggestions?
Unfortunately not. I edited my experiment through the Builder a little bit, and now it does not get stuck at “initializing screen” but it keeps giving me other errors as I go through. I’m wondering if any of those are related to this problem.
I disabled saving partial data, but unfortunately I can only set it to piloting as my institution has not allowed me any credits yet. Currently, I believe the problem is when I am using “data.importConditions” to read from my files. I get the error data not defined. I have seen some solutions where they add some JS code to the beginning of the experiment, but it doesn’t work for me as I use this in 3 different places, and I generate the name of the file randomly in that routine.
To go into more detail, this is the JS code I am referring to: