OSWeb: Uncaught TypeError: Cannot read property 'length' of null
Dear experts,
Whenever I try running my experiment with OSWeb (chrome and firefox) it crashes when trying to run a list with the following error message "Uncaught TypeError: Cannot read property 'length' of null". It works fine with OpenSesame on the computer.
Below is the more detailed error message from the browser. Note, that the CORS policy error seems to be a different error from the main error about the null property, because I have run a longer version of the experiment and Part1 ran successfully after the CORS error, but crashed later in Part2 (this output is from a reduced version with only the problematic part). Or can they be related?
Does anyone have an idea of what the problem might be?
The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
./src/app.js @ tmpjj9jzxfm.html:35
tmpjj9jzxfm.html:35 osweb v1.3.9
tmpjj9jzxfm.html:229 The used subject number is 0
tmpjj9jzxfm.html:97
PixiJS 5.2.4 - ✰ WebGL 2 ✰ http://www.pixijs.com/ ♥♥♥
tmpjj9jzxfm.html:1 Access to image at 'file:///C:/Users/Fredrik.DESKTOP-ES55C09/AppData/Local/Temp/img/opensesame.png' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
opensesame.png:1 Failed to load resource: net::ERR_FAILED
tmpjj9jzxfm.html:97 Uncaught (in promise) Event
tmpjj9jzxfm.html:35 Uncaught TypeError: Cannot read property 'length' of null
at Sketchpad.prepare_allowed_responses (tmpjj9jzxfm.html:35)
at Sketchpad.prepare (tmpjj9jzxfm.html:35)
at Sketchpad.prepare (tmpjj9jzxfm.html:35)
at ItemStore.prepare (tmpjj9jzxfm.html:35)
at Sequence._prepare_complete (tmpjj9jzxfm.html:35)
at Sequence.prepare (tmpjj9jzxfm.html:35)
at ItemStore.prepare (tmpjj9jzxfm.html:35)
at Loop.run (tmpjj9jzxfm.html:35)
at ItemStore.run (tmpjj9jzxfm.html:35)
at Sequence.run (tmpjj9jzxfm.html:35)
DevTools failed to load SourceMap: Could not load content for file:///C:/Users/Fredrik.DESKTOP-ES55C09/AppData/Local/Temp/vendors~osweb.1.3.9.bundle.js.map: System error: net::ERR_FILE_NOT_FOUND
DevTools failed to load SourceMap: Could not load content for file:///C:/Users/Fredrik.DESKTOP-ES55C09/AppData/Local/Temp/vendors~osweb.1.3.9.bundle.css.map: System error: net::ERR_FILE_NOT_FOUND
Comments
I've been running into the same exact issue the past couple days.
I solved mine. In a previous post one of the developers mentioned a similar error had to do with file extensions (e.g. .wav, .jpeg) so I normalized all of my audio files to .wav and images to .png, which solved the issue
Unfortunately, my error cannot be related to extensions because I can successfully run some parts of the experiment (using .JPG), but it always crashes at a specific part when the experiment try to run a list/loop.
PS: I nonetheless changed to .png to reduce the size of the files, and replicated the error.
I tracked the source to specific sketchpads within the list/loop rather than the list/loop itself, and the issue was resolved when I replaced them with new sketchpads. I suspect there was some leftover code from previous use that had not been removed.
Great, thanks for letting us know!
Did you like my answer? Feel free to