WebGL port, loads the scene OK but it crash when pressing a UI button

This is the error that im getting

An error occured running the Unity content on this page. See your browser's JavaScript console for more info. The error was:
uncaught exception: abort() at jsStackTrace@http://127.0.0.1/test/Development/test.js:875:12
stackTrace@http://127.0.0.1/test/Development/test.js:889:21
abort@http://127.0.0.1/test/Development/test.js:2755743:24
nullFunc_viii@http://127.0.0.1/test/Development/test.js:14449:2
b150@http://127.0.0.1/test/Development/test.js:2746947:2
__ZN23InterfaceActionInvoker1IP21PointerEventData_t229E6InvokeEP10MethodInfoPvS1_ [void undefined<undefined?n?>?o? InterfaceActionInvoker1<PointerEventData_t229?*, undefined?6?>?k()]@http://127.0.0.1/test/Development/test.js:2503179:2
__Z27ExecuteEvents_Execute_m1300P8Object_tS0_P18BaseEventData_t281P10MethodInfo [ExecuteEvents_Execute_m1300?0(Object_t?S?*)]@http://127.0.0.1/test/Development/test.js:2418789:1
__Z37EventFunction_1_Invoke_m23226_gsharedP21EventFunction_1_t3957P8Object_tP18BaseEventData_t281P10MethodInfo [EventFunction_1_Invoke_m23226_gshared(MethodInfo?****)]@http://127.0.0.1/test/Development/test.js:2455516:2
__ZN18VirtActionInvoker2IP8Object_tP18BaseEventData_t281E6InvokeEP10MethodInfoPvS1_S3_ [void undefined<undefined?n?>?o? VirtActionInvoker2<BaseEventData_t281?**, undefined?6?>?k()]@http://127.0.0.1/test/Development/test.js:2475608:2
dynCall_viiii@http://127.0.0.1/test/Development/test.js:2707652:2
invoke_viiii@http://127.0.0.1/test/Development/test.js:15551:3
__Z56ExecuteEvents_Execute_TisIPointerDownHandler_t274_m37237P8Object_tP14GameObject_t23P18BaseEventData_t281P20EventFunction_1_t299P10MethodInfo [ExecuteEvents_Execute_TisIPointerDownHandler_t274_m37237(MethodInfo?*****)]@http://127.0.0.1/test/Development/test.js:958008:7
__Z64ExecuteEvents_ExecuteHierarchy_TisIPointerDownHandler_t274_m2557P8Object_tP14GameObject_t23P18BaseEventData_t281P20EventFunction_1_t299P10MethodInfo [ExecuteEvents_ExecuteHierarchy_TisIPointerDownHandler_t274_m2557(MethodInfo?*****)]@http://127.0.0.1/test/Development/test.js:1863435:7
__Z45StandaloneInputModule_ProcessMousePress_m1486P26StandaloneInputModule_t348P25MouseButtonEventData_t341P10MethodInfo [StandaloneInputModule_ProcessMousePress_m1486(MethodInfo?***)]@http://127.0.0.1/test/Development/test.js:863676:8
__Z45StandaloneInputModule_ProcessMouseEvent_m1483P26StandaloneInputModule_t348P10MethodInfo [StandaloneInputModule_ProcessMouseEvent_m1483(MethodInfo?**)]@http://127.0.0.1/test/Development/test.js:1386628:2
__Z35StandaloneInputModule_Process_m1478P26StandaloneInputModule_t348P10MethodInfo [StandaloneInputModule_Process_m1478(MethodInfo?**)]@http://127.0.0.1/test/Development/test.js:2361416:2
__ZN18VirtActionInvoker06InvokeEP10MethodInfoPv [VirtActionInvoker0::Invoke(void**)]@http://127.0.0.1/test/Development/test.js:2567736:2
__Z24EventSystem_Update_m1273P16EventSystem_t283P10MethodInfo [EventSystem_Update_m1273(MethodInfo?**)]@http://127.0.0.1/test/Development/test.js:1612978:2
__Z23RuntimeInvoker_Void_t57P10MethodInfoPvPS1_ [RuntimeInvoker_Void_t57?1(void**, undefined?S?*)]@http://127.0.0.1/test/Development/test.js:2695849:2
dynCall_iiii@http://127.0.0.1/test/Development/test.js:2721342:9
invoke_iiii@http://127.0.0.1/test/Development/test.js:16247:10
__ZN6il2cpp2vm7Runtime6InvokeEP10MethodInfoPvPS4_PP12Il2CppObject [il2cpp::vm::Runtime::Invoke?4(void**, undefined?S?*)]@http://127.0.0.1/test/Development/test.js:2370384:7
_il2cpp_runtime_invoke@http://127.0.0.1/test/Development/test.js:2672857:7
__Z23scripting_method_invoke21ScriptingMethodIl2CppP15ScriptingObjectR18ScriptingArgumentsPP18ScriptingException [scripting_method_invoke?2()]@http://127.0.0.1/test/Development/test.js:2600478:7
__ZN25ScriptingInvocationNoArgs6InvokeEPP18ScriptingException [ScriptingInvocationNoArgs::Invoke(ScriptingException?**)]@http://127.0.0.1/test/Development/test.js:1796254:7
__ZN25ScriptingInvocationNoArgs6InvokeEv [ScriptingInvocationNoArgs::Invoke()]@http://127.0.0.1/test/Development/test.js:2637348:7
__ZN13MonoBehaviour16CallUpdateMethodEi [MonoBehaviour::CallUpdateMethod(int)]@http://127.0.0.1/test/Development/test.js:1699473:2
__ZN13MonoBehaviour6UpdateEv [MonoBehaviour::Update()]@http://127.0.0.1/test/Development/test.js:2723401:2
__ZN20BaseBehaviourManager12CommonUpdateI16BehaviourManagerEEvv [undefined BaseBehaviourManager::CommonUpdate<BehaviourManager?>(void, void)]@http://127.0.0.1/test/Development/test.js:1358120:4
__ZN16BehaviourManager6UpdateEv [BehaviourManager::Update()]@http://127.0.0.1/test/Development/test.js:2705623:2
dynCall_vi@http://127.0.0.1/test/Development/test.js:2745930:2
invoke_vi@http://127.0.0.1/test/Development/test.js:16071:3
__Z10PlayerLoopbbP10IHookEvent [PlayerLoop(bool, bool, IHookEvent?*)]@http://127.0.0.1/test/Development/test.js:162937:8
__ZL8mainloopv [mainloop()]@http://127.0.0.1/test/Development/test.js:2437234:2
dynCall_v@http://127.0.0.1/test/Development/test.js:2749090:2
Runtime.dynCall@http://127.0.0.1/test/Development/test.js:206:11
Browser_mainLoop_runner/<@http://127.0.0.1/test/Development/test.js:10395:5
Browser.mainLoop.runIter@http://127.0.0.1/test/Development/test.js:7184:5
Browser_mainLoop_runner@http://127.0.0.1/test/Development/test.js:10391:3

Looking at the log, this might be a case where the function it is trying to call in response to the button press might have incorrectly been stripped. Does this also happen with stripping disabled?

stripping is disabled, there is something else that may cause that?

OK, im trying to narrow this one, its slow because i can only test in build, everything is fine at the editor.

Im not sure yet, but this is the prime suspect, its not the first time i found conflicts on the event system

#pragma strict
import UnityEngine.EventSystems;
import System.Collections.Generic;

class UIMouseOver extends MonoBehaviour implements IPointerDownHandler
{
    private var Mouse : MouseControl;

    function Start()
    {
           var cam=GameObject.Find("MainCamera");
        Mouse=cam.GetComponent(MouseControl);
    }

    function OnPointerDown(eventData : PointerEventData)
    {
       Mouse.MouseOnUI = true;
       Mouse.UIDragging = this.transform;
    }
}

this script is petty much attached intro every canvas element + buttons, a regular button whiout it does not crash the webgl build, but with it, it does, im suspecting “IPointerDownHandler” is conflicting with the “OnClick” that a button has, in the past i had IPointerUpHandler conflicting and causing weird things if used on the same gameobject with a event trigger using “on pointer”.

EDIT: yeah im totally convinced thats the problem, the event system just dont like that, is this a bug? it works on the editor and another platforms. And its not a conflict, it just crashes every time a click a element with the script present.

This very much sounds like a bug in either il2cpp or the UnusedByteCodeStripper. Can you file a repro case for us to take a look?

report filed.

The funny thing is, it took 2 mins to isolate the problem, just the script that causes the problem and a fake “MouseControl”.

thanks.

For the record, the bug was accepted, and they also said it only happens on JS, C# works fine.