# Promise.delay is not a function error

**URL:** https://forum.makecode.com/t/promise-delay-is-not-a-function-error/12731
**Category:** PXT
**Created:** [March 16, 2022, 6:09pm UTC](https://forum.makecode.com/t/promise-delay-is-not-a-function-error/12731 "2022-03-16T18:09:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![JoeeSM](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@JoeeSM](https://forum.makecode.com/u/JoeeSM)
#### Post date: [March 16, 2022, 6:09pm UTC](https://forum.makecode.com/t/promise-delay-is-not-a-function-error/12731/1 "2022-03-16T18:09:29Z")

</div>

Hi, I am new to the MakeCode platform and I have started to create my own local simulator. However, the ‘Promise.delay’ function is throwing an error when an API tries to use it. I am not to sure what is causing this, as I think I have all the correct libraries to run the simulator locally. Where am I going wrong?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/d/d95fc08efafda301238500fc59c4f30cf10f11ab.png)

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [March 16, 2022, 6:11pm UTC](https://forum.makecode.com/t/promise-delay-is-not-a-function-error/12731/2 "2022-03-16T18:11:43Z")

</div>

We recently removed the bluebird library which was the source of the Promise.delay function (it’s not actually part of the promise standard). There’s a replacement function you can use though, try:

```nohighlight
pxsim.U.delay()

```

---

<div class="post-metadata">

### Author: ![JoeeSM](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@JoeeSM](https://forum.makecode.com/u/JoeeSM)
#### Post date: [March 17, 2022, 4:48pm UTC](https://forum.makecode.com/t/promise-delay-is-not-a-function-error/12731/3 "2022-03-17T16:48:52Z")

</div>

This worked, thank you!
