# Error: t.initFunction is not a function

**URL:** <https://forum.babylonjs.com/t/error-t-initfunction-is-not-a-function/45431>\
**Category:** Bugs\
**Tags:** playground\
**Created:** [November 3, 2023, 5:51pm UTC](https://forum.babylonjs.com/t/error-t-initfunction-is-not-a-function/45431 "2023-11-03T17:51:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![apetrovitch](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/apetrovitch/32/35769_2.png) [@apetrovitch](https://forum.babylonjs.com/u/apetrovitch)\
**Post date:** [November 3, 2023, 5:51pm UTC](https://forum.babylonjs.com/t/error-t-initfunction-is-not-a-function/45431/1 "2023-11-03T17:51:23Z")

</div>

error:  
**t.initFunction is not a function**  
persists in playground.

here is a link:

> **[Babylon.js Playground](https://playground.babylonjs.com/#3U6F9T%2393)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

console says:

```auto
rendererComponent.tsx:364 TypeError: t.initFunction is not a function
    at R._compileAndRunAsync (rendererComponent.tsx:295:36) 'Retrying if possible. If this error persists please notify the team.'

```

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [November 3, 2023, 6:41pm UTC](https://forum.babylonjs.com/t/error-t-initfunction-is-not-a-function/45431/2 "2023-11-03T18:41:39Z")

</div>

you need to move the creation of your ammo objects within the createScene as ammo might not be loaded when you start using it [https://playground.babylonjs.com/#3U6F9T#95](https://playground.babylonjs.com/#3U6F9T#95)

---

<div class="post-metadata">

**Author:** ![apetrovitch](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/apetrovitch/32/35769_2.png) [@apetrovitch](https://forum.babylonjs.com/u/apetrovitch)\
**Post date:** [November 4, 2023, 5:58am UTC](https://forum.babylonjs.com/t/error-t-initfunction-is-not-a-function/45431/3 "2023-11-04T05:58:16Z")

</div>

Thank you, that was the solution.

---

<div class="post-metadata">

**Author:** ![Snowden](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/snowden/32/32707_2.png) [@Snowden](https://forum.babylonjs.com/u/Snowden)\
**Post date:** [August 8, 2024, 4:31pm UTC](https://forum.babylonjs.com/t/error-t-initfunction-is-not-a-function/45431/4 "2024-08-08T16:31:38Z")

</div>

For me it was because I had some functions that I was exporting like

```auto
export function foo(){}

```

They were left over from when I was editing my example locally. Once I removed all `export` keywords it worked.
