I have built an experiment in builder. Pushed it to Pavlovia and at first I had the error that several variables were already declared, so I learnt that I need to put ‘let’ before a variable.
This worked, and as I was iteratively adding and removing variables from this list and uploading to psychopy a new error has emerged:
test-audio-node-disc…method-support.ts:5 [Deprecation] The ScriptProcessorNode is deprecated. Use AudioWorkletNode instead. (Enter Audio Worklet - Chrome Developers)
I have no idea what this means or how to fix it.
Any help at all would be greatly appreciated.
I (almost) never add “let”. Are you manually editing the JS side of your code components? Please use Auto code components as often as possible.
What version are you using?
Latest version, I started using ‘let’ because I had errors that any given variable was already declared.
Using let stopped that problem
Also, some code is auto translated, some code is manually written in JS to override python conversion problems like numpy not existing in JS etc.
I think that “let” means that the scope of the variable is reduced to the code component or clause where let occurs.
I fix variable not defined variables by adding varName = 0 (or whatever) on the Python side. Variable already declared suggests a more serious issue. Can you give an example? Online, you shouldn’t edit the value of a variable set by a spreadsheet.
When I did try to do examplevariabe = 0 in either python or JS examplevariable = 0; it would say that the variable was already declared. So instead of placing these initialisers in the snippet before experiment tab I used let instead, and the error went away
Even when I disable the let code, the audio node error still is preventing the experiment from running
There is also this in the console:
Could not load content for https://run.pavlovia.org/HarpreetSingh/neo/node_modules/tone/Tone/core/Global.ts (HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE)