# 2 different errors in 2 different browsers when starting the trial loop

**URL:** <https://discourse.psychopy.org/t/2-different-errors-in-2-different-browsers-when-starting-the-trial-loop/13536>\
**Category:** Online experiments\
**Created:** [May 20, 2020, 6:23pm UTC](https://discourse.psychopy.org/t/2-different-errors-in-2-different-browsers-when-starting-the-trial-loop/13536 "2020-05-20T18:23:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vuandre1](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/vuandre1/32/8603_2.png) [@vuandre1](https://discourse.psychopy.org/u/vuandre1)\
**Post date:** [May 20, 2020, 6:23pm UTC](https://discourse.psychopy.org/t/2-different-errors-in-2-different-browsers-when-starting-the-trial-loop/13536/1 "2020-05-20T18:23:56Z")

</div>

URL of experiment: [Andrew Vu / N-back task with visual stimuli · GitLab](https://gitlab.pavlovia.org/vuandre1/n-back-task-with-visual-stimuli)

Description of the problem:  
After trying to pilot the n-back experiment on [pavlovia.org](http://pavlovia.org), these errors come up as I enter the 1st trial loop, which then creates a 404 error immediately aborting the experiment.

 ![Error1](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/1/d/1da6724f1369d5faa480138edb2632d3ebb4dca2.png)  
This is the “TypeError: Cannot read property ‘0’ of undefined” that occurs on Chrome.

 ![Error2](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/7/5/75c1a13ac3c8965c4e1aad5e408203d55fd1243b.png)  
This is the “TypeError: pos is undefined” that occurs on Firefox.

I am unable to upload another image to show the experiment flow, but the error probably occurs around the ‘// Initialize components for Routine “N\_back\_1\_Trial”’ portion of the “n-back.js”.

The software platform is PsychoJs, the platform version is 2020.1. My partners have suspicions that the errors are because of the “.xlsx” files used as the experiment conditions.

Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![vuandre1](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/vuandre1/32/8603_2.png) [@vuandre1](https://discourse.psychopy.org/u/vuandre1)\
**Post date:** [May 21, 2020, 6:24pm UTC](https://discourse.psychopy.org/t/2-different-errors-in-2-different-browsers-when-starting-the-trial-loop/13536/2 "2020-05-21T18:24:23Z")

</div>

Quick update: The 404 page that the experiment aborts to contains a fragment that says “[0.2,%200.0]” like so:

 ![urlError](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/4/2/42c9f5b69bc671fd4f9e4deadf41ff158764734e.png)  
This text also appears in my condition’s “.xlsx” file under the location column like so:

![conditions](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/a/f/af60c93f315a203d865742b87ae4c027efc7f551.png)  
This may indicate that the way the conditions are being read by PsychoJS are causing the TypeErrors.

---

<div class="post-metadata">

**Author:** ![vuandre1](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/vuandre1/32/8603_2.png) [@vuandre1](https://discourse.psychopy.org/u/vuandre1)\
**Post date:** [May 21, 2020, 7:40pm UTC](https://discourse.psychopy.org/t/2-different-errors-in-2-different-browsers-when-starting-the-trial-loop/13536/3 "2020-05-21T19:40:37Z")

</div>

Solved: I have a test build of the experiment here:

> **[Andrew Vu / nBackTesting](https://gitlab.pavlovia.org/vuandre1/nBackTesting)**
>
> n-back experiment

The change I’ve made was in the condition’s “.xlsx” file like so:

![condFix](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/1/9/192a0e67b562eda08a100a42dd22e03c1cda93ae.png)  
As you can see I’ve spilt the original “location” column into two separate columns. The TypeErrors were most likely caused by the square brackets in the original. I’ve also updated the appropriate properties like so:

![buildUp](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/9/b/9b968f249b903d8db8ea129d9f5334ab5da2b9bd.png)

Hope this will help those who have this problem in the future.

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [May 21, 2020, 9:02pm UTC](https://discourse.psychopy.org/t/2-different-errors-in-2-different-browsers-when-starting-the-trial-loop/13536/4 "2020-05-21T21:02:16Z")

</div>

Glad you found the solution. I was thinking it might be that but hadn’t yet had a chance to post. It’s one of the tips already on my crib sheet.

> **[PsychoPy Python to Javascript crib sheet](https://docs.google.com/document/d/13jp0QAqQeFlYSjeZS0fDInvgaDzBXjGQNe4VNKbbNHQ/edit?usp=sharing)**
>
> PsychoPy version 2020.1.3Python to Javascript Crib Sheet Compiled by Wakefield Morys-Carter, Oxford Brookes UniversityPlease retweet Psych\_Stats. PsychoPy 2020 has an automatic Python to Javascript translation tool. This document contains...
