# Not able to load Scene due to error in button.ts

**URL:** <https://forum.babylonjs.com/t/not-able-to-load-scene-due-to-error-in-button-ts/28952>\
**Category:** Questions\
**Tags:** gui, button\
**Created:** [April 1, 2022, 6:04am UTC](https://forum.babylonjs.com/t/not-able-to-load-scene-due-to-error-in-button-ts/28952 "2022-04-01T06:04:07Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![MG\_Sharma](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mg_sharma/32/22674_2.png) [@MG\_Sharma](https://forum.babylonjs.com/u/MG_Sharma)\
**Post date:** [April 1, 2022, 6:04am UTC](https://forum.babylonjs.com/t/not-able-to-load-scene-due-to-error-in-button-ts/28952/1 "2022-04-01T06:04:07Z")

</div>

I had used babylon js cdns in my project. Everything was working great until yesterday.  
The version got updated from 4.2 to 5. But now i was unable to load the scene. On opening console, I got this error. Any ideas how to solve this.

The error leads to line where i have created a simple button.

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/d/7d9b83db093338d0c7401ed7f1c54f452b51fd4c.png)  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/0/3/0369f8ef410a7243481a1a3ca9d535c845aa8428.png)

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [April 1, 2022, 6:13am UTC](https://forum.babylonjs.com/t/not-able-to-load-scene-due-to-error-in-button-ts/28952/2 "2022-04-01T06:13:59Z")

</div>

CreateSimnpleButton is not a constructor and doesn’t need “new” before creating it, just like the error said. TBH the error should not be presented and i’ll check that, but i believe that if you can it’ll be better to remove it.  
Can I get some information about the app? where is it deployed? or are you developing locally?

---

<div class="post-metadata">

**Author:** ![MG\_Sharma](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mg_sharma/32/22674_2.png) [@MG\_Sharma](https://forum.babylonjs.com/u/MG_Sharma)\
**Post date:** [April 1, 2022, 6:37am UTC](https://forum.babylonjs.com/t/not-able-to-load-scene-due-to-error-in-button-ts/28952/3 "2022-04-01T06:37:30Z")

</div>

right now we have deployed it on local host using XAMPP

---

<div class="post-metadata">

**Author:** ![MG\_Sharma](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mg_sharma/32/22674_2.png) [@MG\_Sharma](https://forum.babylonjs.com/u/MG_Sharma)\
**Post date:** [April 1, 2022, 6:38am UTC](https://forum.babylonjs.com/t/not-able-to-load-scene-due-to-error-in-button-ts/28952/4 "2022-04-01T06:38:01Z")

</div>

I’ll remove the new and check it once. Will update you soon

---

<div class="post-metadata">

**Author:** ![MG\_Sharma](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mg_sharma/32/22674_2.png) [@MG\_Sharma](https://forum.babylonjs.com/u/MG_Sharma)\
**Post date:** [April 1, 2022, 10:19am UTC](https://forum.babylonjs.com/t/not-able-to-load-scene-due-to-error-in-button-ts/28952/5 "2022-04-01T10:19:06Z")

</div>

On removing new, the error was resolved, however, now its throwing another error

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/f/1/f11ec1c0655f43541658ed2d31d6ef3d97515ae2.png)

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [April 1, 2022, 12:47pm UTC](https://forum.babylonjs.com/t/not-able-to-load-scene-due-to-error-in-button-ts/28952/6 "2022-04-01T12:47:25Z")

</div>

that’s related to the model you are trying to load. Make sure you are serving all needed files in order to serve the model correctly.

Can I ask - are you using our npm packages? which one did you take? UMD? or ES6? and what version?

---

<div class="post-metadata">

**Author:** ![MG\_Sharma](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mg_sharma/32/22674_2.png) [@MG\_Sharma](https://forum.babylonjs.com/u/MG_Sharma)\
**Post date:** [April 2, 2022, 5:03am UTC](https://forum.babylonjs.com/t/not-able-to-load-scene-due-to-error-in-button-ts/28952/7 "2022-04-02T05:03:09Z")

</div>

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/9/3/93f0f008c3f1507e7a63056e6b2b476ab6894063.png)

I am using these scripts.

---

<div class="post-metadata">

**Author:** ![MG\_Sharma](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mg_sharma/32/22674_2.png) [@MG\_Sharma](https://forum.babylonjs.com/u/MG_Sharma)\
**Post date:** [April 2, 2022, 5:04am UTC](https://forum.babylonjs.com/t/not-able-to-load-scene-due-to-error-in-button-ts/28952/8 "2022-04-02T05:04:50Z")

</div>

I’ll check the model once. Didn’t faced this issue while loading in the earlier version.

---

<div class="post-metadata">

**Author:** ![MG\_Sharma](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mg_sharma/32/22674_2.png) [@MG\_Sharma](https://forum.babylonjs.com/u/MG_Sharma)\
**Post date:** [April 2, 2022, 5:33am UTC](https://forum.babylonjs.com/t/not-able-to-load-scene-due-to-error-in-button-ts/28952/9 "2022-04-02T05:33:40Z")

</div>

The scene loads perfectly when loaded on local host. But when I upload on a cPanel Server , the scene shows this model error.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [April 2, 2022, 12:51pm UTC](https://forum.babylonjs.com/t/not-able-to-load-scene-due-to-error-in-button-ts/28952/10 "2022-04-02T12:51:19Z")

</div>

Hey hard to say. Might be related to CORS or to the correct URL of the model. If you want to share a url we might be able to point to the reason

---

<div class="post-metadata">

**Author:** ![MG\_Sharma](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mg_sharma/32/22674_2.png) [@MG\_Sharma](https://forum.babylonjs.com/u/MG_Sharma)\
**Post date:** [April 4, 2022, 9:37am UTC](https://forum.babylonjs.com/t/not-able-to-load-scene-due-to-error-in-button-ts/28952/11 "2022-04-04T09:37:39Z")

</div>

I don’t know if I could share the model.

However I noticed one thing, the error is caused by idb storage which I had used to optimize scene.

BABYLON.Database.IDBStorageEnabled = true.

The scene loads once when opened in new browser. But when I reload the site, it throws the same loading error

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [April 4, 2022, 8:24pm UTC](https://forum.babylonjs.com/t/not-able-to-load-scene-due-to-error-in-button-ts/28952/12 "2022-04-04T20:24:21Z")

</div>

If you used is once and don’t need it you can remove the database that was created using chrome dev tools, but it shouldn’t influence your app. If it does it might be a bug that needs to be fixed

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [May 3, 2022, 12:04pm UTC](https://forum.babylonjs.com/t/not-able-to-load-scene-due-to-error-in-button-ts/28952/13 "2022-05-03T12:04:54Z")

</div>

Hello @MG_Sharma just checking in, are you still having issues?
