# Online error "\_Blank\_ is not a constructor"

**URL:** https://discourse.psychopy.org/t/online-error-blank-is-not-a-constructor/31453
**Category:** Online experiments
**Tags:** online, coding, pavlovia
**Created:** [October 19, 2022, 6:44pm UTC](https://discourse.psychopy.org/t/online-error-blank-is-not-a-constructor/31453 "2022-10-19T18:44:21Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![aboye](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@aboye](https://discourse.psychopy.org/u/aboye)
#### Post date: [October 19, 2022, 6:44pm UTC](https://discourse.psychopy.org/t/online-error-blank-is-not-a-constructor/31453/1 "2022-10-19T18:44:21Z")

</div>

URL of experiment: [DietCognitions SONA [PsychoPy]](https://run.pavlovia.org/aboye/tasknewassoc/)

Description of the problem:  
Hi. I am not an experienced coder. I coped a task that works online exactly as is onto my task. I am getting the error “core.Clock is not a constructor”. Please help. Thank you in advance.

---

<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: [October 19, 2022, 7:28pm UTC](https://discourse.psychopy.org/t/online-error-blank-is-not-a-constructor/31453/2 "2022-10-19T19:28:14Z")

</div>

As per my crib sheet core.Clock() should be manually translated to new util.Clock()

> **[PsychoPy Python to Javascript crib sheet 2021](https://docs.google.com/document/d/183xmwDgSbnJZHMGf3yWpieV9Bx8y7fOCm3QKkMOOXFQ/edit)**
>
> PsychoPy version 2021.1.3-2021.2.3Python to JavaScript Crib Sheet Compiled by Wakefield Morys-Carter, Oxford Brookes UniversityPlease share widely and follow Psych\_Stats on twitter. PsychoPy 2021 is a major update with several new features. When...

---

<div class="post-metadata">

### Author: ![aboye](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@aboye](https://discourse.psychopy.org/u/aboye)
#### Post date: [October 19, 2022, 7:56pm UTC](https://discourse.psychopy.org/t/online-error-blank-is-not-a-constructor/31453/3 "2022-10-19T19:56:15Z")

</div>

Hello,

I have replaced “core.Clock()” with “util.Clock()” and the problem persists. Thanks.

---

<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: [October 19, 2022, 8:00pm UTC](https://discourse.psychopy.org/t/online-error-blank-is-not-a-constructor/31453/4 "2022-10-19T20:00:02Z")

</div>

Your experiment still contains

```auto
timing = new core.Clock();

```

---

<div class="post-metadata">

### Author: ![aboye](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@aboye](https://discourse.psychopy.org/u/aboye)
#### Post date: [October 19, 2022, 8:22pm UTC](https://discourse.psychopy.org/t/online-error-blank-is-not-a-constructor/31453/5 "2022-10-19T20:22:09Z")

</div>

Hi, I have looked through all of the codes that are implemented in this task many times and I do not see it there. I attached two screenshots where it has the new code. I made sure this was synced with the online version and the problem persists. Thank you.

 ![Screenshot (521)](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/f/1/f1c91452eed4681faedaaf819ca11507b1d8058c.png)

 ![Screenshot (522)](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/b/b/bb0f3b3099e6c5dc87d5238bc3219258425a52f6.png)

---

<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: [October 19, 2022, 8:30pm UTC](https://discourse.psychopy.org/t/online-error-blank-is-not-a-constructor/31453/6 "2022-10-19T20:30:04Z")

</div>

You are showing a Python (Py) code component. Switch it to Auto to create the JS and then to Both if you need to edit the JS.

---

<div class="post-metadata">

### Author: ![aboye](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@aboye](https://discourse.psychopy.org/u/aboye)
#### Post date: [October 20, 2022, 2:50pm UTC](https://discourse.psychopy.org/t/online-error-blank-is-not-a-constructor/31453/7 "2022-10-20T14:50:10Z")

</div>

Thank you for the help, that solved that issue. Now I get this error.

 ![Screenshot (523)](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/d/c/dc72dc7b5d058f9f7ef77482aaaf2b4cd7fa9fa5.png)

---

<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: [October 20, 2022, 2:59pm UTC](https://discourse.psychopy.org/t/online-error-blank-is-not-a-constructor/31453/8 "2022-10-20T14:59:24Z")

</div>

Have a look at the Developer console to see the line giving the error.

[https://psychopy.org/online/psychoJSCodingDebugging.html](https://psychopy.org/online/psychoJSCodingDebugging.html)

---

<div class="post-metadata">

### Author: ![aboye](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@aboye](https://discourse.psychopy.org/u/aboye)
#### Post date: [October 20, 2022, 3:48pm UTC](https://discourse.psychopy.org/t/online-error-blank-is-not-a-constructor/31453/9 "2022-10-20T15:48:13Z")

</div>

Hi,

It looks like this is causing the error. Thanks.

 ![Screenshot (524)](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/e/0/e0a261f4e32d38da0050f731c58e9c3f6216aa23.png)

---

<div class="post-metadata">

### Author: ![aboye](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@aboye](https://discourse.psychopy.org/u/aboye)
#### Post date: [October 21, 2022, 10:10pm UTC](https://discourse.psychopy.org/t/online-error-blank-is-not-a-constructor/31453/10 "2022-10-21T22:10:51Z")

</div>

Do you have any idea how to solve this error?

Thanks.

---

<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: [October 21, 2022, 10:19pm UTC](https://discourse.psychopy.org/t/online-error-blank-is-not-a-constructor/31453/11 "2022-10-21T22:19:59Z")

</div>

Try removing np.NAN since numpy doesn’t work online.

What I do is remove and replace lines a few at a time to narrow down the error.
