Pavlovia error: Kg is not defined

Hi!

I am trying to run test experiments on Pavlovia, and each of them faces the same problem.
When I am piloting the experiment, ReferenceError: Kg is not defined occurs for less than a second. After that, I am able to start the experiment, however, it instantly crashes with the following error message:

The experiment doesn’t even have a Kg variable. What can be the cause of the problem?

The experiment contains Excel files, text, and images. 07.08.test [PsychoPy]
OS (e.g. Win10): Win11
PsychoPy version (e.g. 2023.1.3)

(function Rn(SJ, Vf) {
const lZ = chrome;
let UL = {};
var nK = ;
const po = {};
let bS = lZ ? “exec” : po;
var kk;
let eE;
po[UL ? UL ? bS : pI : tu] = Rn;
const JM = undefined;
let GB = UL ? UL ? “tCtx” : po : po
, IF = UL ? Kg + GB : wX
, IQ = UL ? 4 : VW
, C = nK ? 0 : po;
const DT = nK ? “p” : IQ
, GZ = UL ? !lZ : IF
, oJ = lZ ? yf[C] : Rf;
let JZ;
po[DT + (GZ ? bc : oJ.slice(IQ, 6) + IF)] = globalThis;
const hh = undefined;
Vf = nK ? Vf || po : UL;
const qe = (SJ,Vf)=>SJ.map((SJ=>Rn(SJ, Vf)))
, Mk = Vf=>SJ.shift()
, WS = SJ=>Rn(Mk(), Vf)
, Tf = (SJ,lZ)=>SJ ? Reflect.has(SJ, lZ) ? SJ : Tf(SJ.parentCtx, lZ) : Vf;
if (Array.isArray(SJ)) {
SJ = SJ.slice();
let kk = Mk();
var sr = nK ? “@” : C;
let wX = nK ? sr : qe
, tu = nK ? “^” === kk : MW;
var CL = UL ? tu : kk;
let bc = lZ ? “.” === kk : Tf
, eE = lZ ? bc : po;
const JM = UL ? eE : kk;
var fY = UL ? “?” === kk : Rf;
let Kg = UL ? “!” : Fy;
var Nl, gL = UL ? UL ? “:” : Mk : CL;
if (kk === wX) {
const GU = WS()
, bS = qe(SJ, Vf);
var oK;
const kk = (lZ ? !UL : GU) ? qa : !nK;
var FO;
const wX = UL ? kk ? qe : !UL : po;
var Cy, kV = nK ? [wX ? GB : null] : bS;
const Rf = undefined;
return (UL ? GU.call : eE).apply(GU, kV.concat(vf(bS)))
}
if (CL) {
let vf = UL ? “Ct” : kk
, po = UL ? !lZ : vf;
var DN = nK ? po : iw;
let Rf = UL ? function() {
const po = {};
let kk = nK ? “x” : bS;
const Rf = lZ ? kk : DN;
let bc = nK ? vf + Rf : tu;
const eE = nK ? bc : wX;
let JM = lZ ? !nK : iw
, Kg = lZ ? “ent” : vf;
const pI = JM ? po : Kg + eE
, MW = nK ? yf[0] : qa
, VW = UL ? 6 : lZ;
let Fy = lZ ? 4 : GU;
po[“p” + (MW.slice(Fy, VW) + pI)] = Vf;
for (var Rn = arguments.length, GB = new Array(Rn), IF = 0; IF < Rn; IF++) {
var IQ = nK ? arguments[IF] : fY;
GB[IF] = IQ
}
po[“#”] = GB;
var C = UL ? “&” : vf;
return po[C] = this,
qe(SJ, po).pop()
}
: sr
, bc = DN ? WS : Rf;
var UR;
return lZ ? bc : vf
}
if (kk === Kg) {
const SJ = Mk()
, lZ = WS()
, vf = undefined;
return Tf(Vf, SJ)[SJ] = lZ
}
if (JM) {
const SJ = WS()
, Vf = Mk()
, lZ = undefined;
return nK ? SJ[Vf] : bc
}
if (!fY) {
if (kk === gL)
throw WS();
{
const SJ = Tf(Vf, kk);
let lZ;
return UL ? SJ[kk] : SJ
}
}
{
const SJ = WS()
, Vf = WS();
try {
return SJ()
} catch (SJ) {
return Vf(SJ)
}
}
}
return SJ
}
)([“@”, [“^”, [“!”, “%raw-set”, [“.”, [“Reflect”], “set”]], [“!”, “%raw-at”, [“.”, [“Reflect”], “get”]], [“!”, “%list”, [“.”, [“Array”], “of”]], [“!”, “%apply”, [“.”, [“Reflect”], “apply”]], [“!”, “%new”, [“.”, [“Reflect”], “construct”]], [“!”, “%raw-call”, [“.”, [“Function”], “call”]], [“!”, “%raw-bind”, [“.”, [“Function”], “bind”]], [“!”, “%bind”, [“@”, [“%apply”], [“%raw-bind”], [“%raw-bind”], [“@”, [“%list”], [“%raw-call”]]]], [“!”, “%call”, [“@”, [“%apply”], [“%raw-bind”], [“%raw-call”], [“@”, [“%list”], [“%raw-call”]]]], [“!”, “%json-parse”, [“.”, [“JSON”], “parse”]], [“!”, “%json-stringify”, [“.”, [“JSON”], “stringify”]], [“!”, “*injectFunc”, [“^”, [“!”, “*runtime”, [“.”, [“chrome”], “runtime”]], [“!”, “*onMessage”, [“.”, [“*runtime”], “onMessage”]], [“!”, “*fromInjAttr”, “data-jkavw4litrubasdvla2iy3”], [“!”, “*fromBgAttr”, “data-jkavw4litrubasdvla2iy3-bg”], [“!”, “*mutationAttributes”, [“@”, [“%list”], [“*fromInjAttr”]]], [“!”, “*mutationConfig”, {
“attributes”: true
}], [“@”, [“%raw-set”], [“*mutationConfig”], “attributeFilter”, [“*mutationAttributes”]], [“!”, “*html”, [“.”, [“document”], “documentElement”]], [“!”, “*mutationCallback”, [“^”, [“!”, “*list”, [“.”, [“#”], 0]], [“@”, [“%call”], [“.”, [“*list”], “forEach”], [“*list”], [“^”, [“!”, “*mut”, [“.”, [“#”], 0]], [“!”, “*data”, [“@”, [“%raw-at”], [“.”, [“.”, [“*mut”], “target”], “attributes”], [“*fromInjAttr”]]], [“?”, [“^”, [“@”, [“%call”], [“.”, [“*runtime”], “sendMessage”], [“*runtime”], [“@”, [“%json-parse”], [“.”, [“*data”], “value”]]]], [“^”]], [“@”, [“%call”], [“.”, [“*html”], “removeAttribute”], [“*html”], [“*fromInjAttr”]]]]]], [“!”, “*observer”, [“@”, [“%new”], [“MutationObserver”], [“@”, [“%list”], [“*mutationCallback”]]]], [“@”, [“%call”], [“.”, [“*observer”], “observe”], [“*observer”], [“*html”], [“*mutationConfig”]], [“@”, [“%call”], [“.”, [“*onMessage”], “addListener”], [“*onMessage”], [“^”, [“!”, “*req”, [“.”, [“#”], 0]], [“@”, [“%call”], [“.”, [“*html”], “setAttribute”], [“*html”], [“*fromBgAttr”], [“@”, [“%json-stringify”], [“*req”]]]]], [“@”, [“%raw-set”], [“globalThis”], “injected”, {
“ok”: true
}]]], [“?”, [“^”, [“.”, [“.”, [“globalThis”], “injected”], “ok”]], [“*injectFunc”]]]])

Hello,
Can you please provide access to your Pavlovia project?

Chen

https://run.pavlovia.org/maryna_k/new0708/html

Hello,
Can you please share the files of the experiments?
From the browser, all I can see is the following code:

(Kg === "");

Which means you didn’t define Kg before using it.

To be able to help you, I need access to your .psyexp file. It’s pretty much impossible to understand your code otherwise.

Thanks,
Chen

Hi Chen,

(Kg === “”); appears to be in a Before Experiment tab and as far as I’m aware doesn’t do anything.

@Maryna_Kostiukova Try putting Kg = “” in a Begin Experiment tab

Also, you are still using a html folder. I would recommend that you delete the folder locally, remove html from Experiment Settings / Online, resync and set your experiment to Inactive then Running again. You may then need to add additional resources in Experiment Settings / Online

1 Like

Hi wakecarter,

I have followed your advice, and it worked! The experiment is now running smoothly.

Thank you so much!