# HTML5 Crash on level load

**URL:** <https://forum.defold.com/t/html5-crash-on-level-load/66221>\
**Category:** Questions\
**Created:** [September 5, 2020, 12:36am UTC](https://forum.defold.com/t/html5-crash-on-level-load/66221 "2020-09-05T00:36:57Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Epitaph64](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/epitaph64/32/39288_2.png) [@Epitaph64](https://forum.defold.com/u/Epitaph64)\
**Post date:** [September 5, 2020, 12:36am UTC](https://forum.defold.com/t/html5-crash-on-level-load/66221/1 "2020-09-05T00:36:57Z")

</div>

This only happens for HTML5 and Android. PC builds work fine:

RuntimeError: abort(Assertion failed: parent\_id, at: ../src/gameobject/gameobject.cpp,1186,CollectionSpawnFromDescInternal). Build with -s ASSERTIONS=1 for more info.

I still haven’t been able to figure out how to build the engine and replace the dmEngine.exe properly yet otherwise I could show the full assertion list. When I build the engine the build succeeds when I don’t run the tests but I don’t see a dmEngine.exe anywhere in order to swap out the engine executable for the full build assertions.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [September 5, 2020, 6:42am UTC](https://forum.defold.com/t/html5-crash-on-level-load/66221/2 "2020-09-05T06:42:07Z")

</div>

Which version of Defold are you using?

---

<div class="post-metadata">

**Author:** ![Epitaph64](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/epitaph64/32/39288_2.png) [@Epitaph64](https://forum.defold.com/u/Epitaph64)\
**Post date:** [September 5, 2020, 6:52am UTC](https://forum.defold.com/t/html5-crash-on-level-load/66221/3 "2020-09-05T06:52:26Z")

</div>

Using 1.2.172

---

<div class="post-metadata">

**Author:** ![Epitaph64](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/epitaph64/32/39288_2.png) [@Epitaph64](https://forum.defold.com/u/Epitaph64)\
**Post date:** [September 5, 2020, 9:00am UTC](https://forum.defold.com/t/html5-crash-on-level-load/66221/4 "2020-09-05T09:00:40Z")

</div>

Hmm I look higher up on the crash log and see a warning:

> WebGL warning: getParameter: pname: Invalid enum value MAX\_ELEMENTS\_VERTICES [UndiscoveredTerritories\_wasm.js:1:145932](http://localhost:54427/html5/UndiscoveredTerritories_wasm.js)
> 
> WebGL warning: getParameter: pname: Invalid enum value MAX\_ELEMENTS\_INDICES [UndiscoveredTerritories\_wasm.js:1:145932](http://localhost:54427/html5/UndiscoveredTerritories_wasm.js)

This is after I added new models to the game. Is there some way to increase these values?

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [September 5, 2020, 9:04am UTC](https://forum.defold.com/t/html5-crash-on-level-load/66221/5 "2020-09-05T09:04:06Z")

</div>

Those are warnings. And the warning is about the enum itself, not the actual setting. You can ignore this.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [September 5, 2020, 9:12am UTC](https://forum.defold.com/t/html5-crash-on-level-load/66221/6 "2020-09-05T09:12:31Z")

</div>

You won’t find “dmEngine.exe”, since you compile for either html5 or Android. They’re called .js/.wasm for html5 or .so for Android.

You’ll find them under e.g. `tmp/dynamo_home/bin/wasm-web`.  
Copy the changed files to the correct counterparts in your build or bundle folder, then refresh the page.

For Android/iOS, we have the `./scripts/mobile/android-repack.sh`/`./scripts/mobile/io-repack.sh` to help with that, to make the process/resigning easier.

Also, by using `adb logcat` you can see the log of your process on your phone.

---

<div class="post-metadata">

**Author:** ![Epitaph64](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/epitaph64/32/39288_2.png) [@Epitaph64](https://forum.defold.com/u/Epitaph64)\
**Post date:** [September 5, 2020, 11:22pm UTC](https://forum.defold.com/t/html5-crash-on-level-load/66221/7 "2020-09-05T23:22:12Z")

</div>

I posted a new thread relating to trying to compile Defold here: [Attempting to build wasm-web version of engine - #4 by Epitaph64](https://forum.defold.com/t/attempting-to-build-wasm-web-version-of-engine/66227/4) I am able to build the Desktop version of the engine without issue but am having issues building the wasm-web version. I think if I can fix the bug there it will be closer to working on Android since the behavior on both platforms is the same whereas Desktop works without issue.

---

<div class="post-metadata">

**Author:** ![aglitchman](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/aglitchman/32/19432_2.png) [@aglitchman](https://forum.defold.com/u/aglitchman)\
**Post date:** [September 5, 2020, 11:36pm UTC](https://forum.defold.com/t/html5-crash-on-level-load/66221/8 "2020-09-05T23:36:27Z")

</div>

> [@Epitaph64](#):
>
> RuntimeError: abort(Assertion failed: parent\_id, at: …/src/gameobject/gameobject.cpp,1186,CollectionSpawnFromDescInternal). Build with -s ASSERTIONS=1 for more info.

I suppose that you have collections with the same “default” name:

 ![image](https://forum-defold.b-cdn.net/uploads/default/original/3X/5/a/5ae230d4398a2c427778d13b34123df792033f41.png)

---

<div class="post-metadata">

**Author:** ![Epitaph64](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/epitaph64/32/39288_2.png) [@Epitaph64](https://forum.defold.com/u/Epitaph64)\
**Post date:** [September 5, 2020, 11:39pm UTC](https://forum.defold.com/t/html5-crash-on-level-load/66221/9 "2020-09-05T23:39:05Z")

</div>

Thanks so much! 😻 I was using a default collection name for one of my collections and renaming it fixed it 😃 I was checking all my objects based on the error but hadn’t thought to look at the master collection names 😮

---

<div class="post-metadata">

**Author:** ![Epitaph64](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/epitaph64/32/39288_2.png) [@Epitaph64](https://forum.defold.com/u/Epitaph64)\
**Post date:** [September 6, 2020, 12:08am UTC](https://forum.defold.com/t/html5-crash-on-level-load/66221/10 "2020-09-06T00:08:15Z")

</div>

Hmm it worked one time. However, after I tried building for Android I got a different error (resource missing.) I fixed this then built HTML5 again and now the error has returned. I checked all my collections and they have different names… Not sure what’s causing it, I’m trying to build defold since I need a version of the wasm-web engine with -s ASSERTS=1 enabled to see the full error message. I’m not even sure that will explain it, but at least I’ll have all the info possible.

EDIT: I figured out the issue. After removing all factories which use 3D Collada models the HTML5 build works fine. However, it does work with meshes. Is this a known bug, or is there some max tri count for Collada models on HTML5 I don’t know about?

EDIT2: I spoke too soon, I’m having issues w/ meshes now. However, I did have them working in HTML5/Android earlier in the project and nothing has changed regarding those objects since then since I moved over to Collada based models…

EDIT3: I’ve finally deduced the reason for the crash. I had previously been doing the shader operation “var\_texcoord0 = texcoord0 \* 2;” in my code to scale the texture. However, after changing this to simply “var\_texcoord0 = texcoord0;” the game builds and plays on HTML5 again! Does anyone know if there’s a way to multiply a variable in a shader for HTML5/Android builds?

---

<div class="post-metadata">

**Author:** ![dapetcu21](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/dapetcu21/32/25120_2.png) [@dapetcu21](https://forum.defold.com/u/dapetcu21)\
**Post date:** [September 6, 2020, 5:09am UTC](https://forum.defold.com/t/html5-crash-on-level-load/66221/11 "2020-09-06T05:09:19Z")

</div>

Make sure it’s valid GLSL. Multiplying with 2 is unlikely to be valid since 2 is an integer constant and vec2s are floats. Try multiplying by 2.0. Some shader compilers are pickier than others.
