# Online Study Crashing

**URL:** <https://discourse.psychopy.org/t/online-study-crashing/2972>\
**Category:** Builder\
**Created:** [August 28, 2017, 1:36pm UTC](https://discourse.psychopy.org/t/online-study-crashing/2972 "2017-08-28T13:36:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![George\_Lovell](https://avatars.discourse-cdn.com/v4/letter/g/a3d4f5/32.png) [@George\_Lovell](https://discourse.psychopy.org/u/George_Lovell)\
**Post date:** [August 28, 2017, 1:36pm UTC](https://discourse.psychopy.org/t/online-study-crashing/2972/1 "2017-08-28T13:36:54Z")

</div>

Hi,

I’m trying a simple study online using the current (1.85.3, running in Windows) version of builder. The study runs fine locally, but when uploaded I’m getting a crash.

The console shows this:

TypeError: Math.seedrandom is not a function  
at new psychoJS.data.TrialHandler (data.js:135)  
at psychoJS.Scheduler.trialsLoopLoopBegin [as currentTask] ((index):826)  
at psychoJS.Scheduler.run (scheduler.js:106)  
at psychoJS.Scheduler.run (scheduler.js:109)  
at update (scheduler.js:145)

If I edit data.js online and comment-out lines 131-136 the experiment does show stimuli, but I’m assuming the random seed isn’t being randomised.

seedrandom doesn’t seem to be available within the js file that is used by index.hml:

LN 25 =

- script type=“text/javascript” src=“js/vendors/Math2.js”\>\</script

Any suggestions why this might be happening?

Best wishes,

George

---

<div class="post-metadata">

**Author:** ![jon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jon/32/22_2.png) [@jon](https://discourse.psychopy.org/u/jon)\
**Post date:** [September 3, 2017, 8:10pm UTC](https://discourse.psychopy.org/t/online-study-crashing/2972/2 "2017-09-03T20:10:31Z")

</div>

Ah, sorry. That was added by @jroberts and his commit message did mention the need to add the seedrandom lib (and links to it). I forgot to do that which is where the problem is coming from.

You’ll need to add it into the js folder you upload to the server and add an import statement into the html file, or possibly add the import direct to the url for the lib?

cheers,  
Jon

> <https://github.com/psychopy/psychojs/commit/e0e4b8d86bfb50b29331991bef9a09b58ef1e809>

---

<div class="post-metadata">

**Author:** ![George\_Lovell](https://avatars.discourse-cdn.com/v4/letter/g/a3d4f5/32.png) [@George\_Lovell](https://discourse.psychopy.org/u/George_Lovell)\
**Post date:** [September 22, 2017, 9:59am UTC](https://discourse.psychopy.org/t/online-study-crashing/2972/3 "2017-09-22T09:59:44Z")

</div>

Hi Jon,

I’ve just checked and the seedrandom.min.js file does seem to be present in the folder that’s uploaded to the webserver, and it’s identical to the one on the repository above. However if I search for “JS\_htmlHeader” in the uploaded folder I’m not finding it.

To be honest I’m unfamiliar with javascript and may be more than a little lost.

Best wishes,

George

---

<div class="post-metadata">

**Author:** ![jon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jon/32/22_2.png) [@jon](https://discourse.psychopy.org/u/jon)\
**Post date:** [September 22, 2017, 10:17am UTC](https://discourse.psychopy.org/t/online-study-crashing/2972/4 "2017-09-22T10:17:01Z")

</div>

I’m also not experienced enough in JS to track this down! I’m afraid I’m going to defer this to the professionals (Ilixa Ltd), who will start in a few weeks time.

---

<div class="post-metadata">

**Author:** ![George\_Lovell](https://avatars.discourse-cdn.com/v4/letter/g/a3d4f5/32.png) [@George\_Lovell](https://discourse.psychopy.org/u/George_Lovell)\
**Post date:** [September 22, 2017, 10:28am UTC](https://discourse.psychopy.org/t/online-study-crashing/2972/5 "2017-09-22T10:28:46Z")

</div>

Yes congrats on the Wellcome grant, looking forward to seeing what they produce.
