Search Unity

WebGL build only working if Exception is enabled

Discussion in 'Web' started by ironfiftynine, Apr 21, 2015.

  1. ironfiftynine

    ironfiftynine

    Joined:
    Jan 22, 2013
    Posts:
    71
    Good day. I'm testing my WebGL build using a WAMP server. My porblem is that if I run a build with Enable Exceptions set to None, the page throws an error which prompts me to look at the browser's javascript console. After confirming the error popup, the game canvas is just left empty. Since the exception is basically disabled, the details of the error message is not displayed.
    When I create a build with the mentioned setting set to Full, Firefox displays a popup saying

    An error occured running the Unity content on this page. See your browser's JavaScript console for more info. The error was:
    InvalidStateError


    But after confirming the popup, the game proceeds to play. For Chrome, the game proceeds to play.

    I attached the screenshots of the web console for Chrome and Firefox.

    Has anyone experienced the same thing? I'm having a hard time finding the problem if it only happens without the exception handling. I would like to ask for suggestions on how to resolve this. Thanks in advance.
     

    Attached Files:

  2. ironfiftynine

    ironfiftynine

    Joined:
    Jan 22, 2013
    Posts:
    71
  3. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    If you enable exceptions, the exception is caught and handled, so you don't see it.

    One thing you can do (Will make this the default behavior in 5.1) is to make a development build and edit your generated .js file to add the line

    Code (csharp):
    1. console.log(stackTrace());
    into the cxa_throw function - this will print the stack trace of the exception to the browser console.
     
    gfoot and ironfiftynine like this.
  4. ironfiftynine

    ironfiftynine

    Joined:
    Jan 22, 2013
    Posts:
    71
    Thank you for responding to my question. I've followed your suggestion and ended up with the following stack trace.

    Error
    at jsStackTrace (http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:875:12)
    at stackTrace (http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:889:21)
    at ___cxa_throw (http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:12290:14)
    at __ZN6il2cpp2vm9Exception5RaiseEP15Il2CppException [il2cpp::vm::Exception::Raise(Il2CppException?*)] (http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2080135:3)
    at __ZL30il2cpp_codegen_raise_exceptionP13Exception_t6263276 [il2cpp_codegen_raise_exception?3(Exception_t62?6?*)] (http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:3387550:2)
    at __Z24CultureInfo__ctor_m20677P17CultureInfo_t2119P8String_tbbP10MethodInfo [CultureInfo__ctor_m20677(bool**, bool, MethodInfo?*)] (http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:1975474:2)
    at Array.__Z32CultureInfo_CreateCulture_m20707P8Object_tP8String_tbP10MethodInfo [CultureInfo_CreateCulture_m20707(bool**, MethodInfo?*)] (http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2680894:2)
    at Array.__Z42RuntimeInvoker_Object_t_Object_t_SByte_t51P10MethodInfoPvPS1_ [RuntimeInvoker_Object_t_Object_t_SByte_t51?1(void**, undefined?S?*)] (http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:3205496:55)
    at __ZN6il2cpp2vm7Runtime6InvokeEP10MethodInfoPvPS4_PP12Il2CppObject [il2cpp::vm::Runtime::Invoke?4(void**, undefined?S?*)] (http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:3208017:56)
    at Array.__ZN6il2cpp6icalls8mscorlib6System10Reflection12AssemblyName9ParseNameEP28Il2CppReflectionAssemblyNameP12Il2CppString [il2cpp::icalls::mscorlib::System::Reflection::AssemblyName::parseName(Il2CppString?**)] (http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:1161585:27)
    Sorry for my lack of knowledge, but I don't know which part of my code is this exception pointing to. Can you give me an idea on what are the possible causes of this exception? Thank you.
     
  5. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Is that the complete stack trace it prints? It seems to be missing some lines.
     
  6. ironfiftynine

    ironfiftynine

    Joined:
    Jan 22, 2013
    Posts:
    71
    Sorry I thought that was all in the stacktrace. Here's the part that I missed:

    Module.printErr @ (index):33
    Runtime.warnOnce @ web_inc_rpg_devbuild.js:250
    demangle @ web_inc_rpg_devbuild.js:864
    (anonymous function) @ web_inc_rpg_devbuild.js:870
    demangleAll @ web_inc_rpg_devbuild.js:869
    stackTrace @ web_inc_rpg_devbuild.js:889
    ___cxa_throw @ web_inc_rpg_devbuild.js:12290
    __ZN6il2cpp2vm9Exception5RaiseEP15Il2CppException @ web_inc_rpg_devbuild.js:2080135
    __ZL30il2cpp_codegen_raise_exceptionP13Exception_t6263276 @ web_inc_rpg_devbuild.js:3387550
    __Z24CultureInfo__ctor_m20677P17CultureInfo_t2119P8String_tbbP10MethodInfo @ web_inc_rpg_devbuild.js:1975474
    __Z32CultureInfo_CreateCulture_m20707P8Object_tP8String_tbP10MethodInfo @ web_inc_rpg_devbuild.js:2680894
    __Z42RuntimeInvoker_Object_t_Object_t_SByte_t51P10MethodInfoPvPS1_ @ web_inc_rpg_devbuild.js:3205496
    __ZN6il2cpp2vm7Runtime6InvokeEP10MethodInfoPvPS4_PP12Il2CppObject @ web_inc_rpg_devbuild.js:3208017
    __ZN6il2cpp6icalls8mscorlib6System10Reflection12AssemblyName9ParseNameEP28Il2CppReflectionAssemblyNameP12Il2CppString @ web_inc_rpg_devbuild.js:1161585
    __Z29AssemblyName_ParseName_m21320P8Object_tP18AssemblyName_t2153P8String_tP10MethodInfo @ web_inc_rpg_devbuild.js:3015596
    __Z25AssemblyName__ctor_m10011P18AssemblyName_t2153P8String_tP10MethodInfo @ web_inc_rpg_devbuild.js:2103486
    __Z29ParseClient_get_Version_m9121P8Object_tP10MethodInfo @ web_inc_rpg_devbuild.js:2248652
    __Z24ParseClient__cctor_m9119P8Object_tP10MethodInfo @ web_inc_rpg_devbuild.js:1181987
    __Z22RuntimeInvoker_Void_t5P10MethodInfoPvPS1_ @ web_inc_rpg_devbuild.js:3323210
    __ZN6il2cpp2vm7Runtime9ClassInitEP8TypeInfo @ web_inc_rpg_devbuild.js:2775393
    __ZL11RuntimeInitP8TypeInfo71863 @ web_inc_rpg_devbuild.js:3303129
    __Z36ParseInitializeBehaviour_Awake_m9219P30ParseInitializeBehaviour_t1838P10MethodInfo @ web_inc_rpg_devbuild.js:1898790
    __Z22RuntimeInvoker_Void_t5P10MethodInfoPvPS1_ @ web_inc_rpg_devbuild.js:3323210
    __ZN6il2cpp2vm7Runtime6InvokeEP10MethodInfoPvPS4_PP12Il2CppObject @ web_inc_rpg_devbuild.js:3208017
    _il2cpp_runtime_invoke @ web_inc_rpg_devbuild.js:3280389
    __Z20il2cpp_invoke_method21ScriptingMethodIl2CppP15ScriptingObjectP18ScriptingArgumentsPP18ScriptingExceptionb @ web_inc_rpg_devbuild.js:2753476
    __ZN19ScriptingInvocation6InvokeEPP18ScriptingExceptionb @ web_inc_rpg_devbuild.js:1771573
    __ZN19ScriptingInvocation6InvokeEPP18ScriptingException @ web_inc_rpg_devbuild.js:3292600
    __ZN25ScriptingInvocationNoArgs13InvokeCheckedEv @ web_inc_rpg_devbuild.js:2965828
    __ZN13MonoBehaviour12AddToManagerEv @ web_inc_rpg_devbuild.js:1261838
    __ZN9Behaviour13AwakeFromLoadE17AwakeFromLoadMode @ web_inc_rpg_devbuild.js:2509219
    __ZN13MonoBehaviour13AwakeFromLoadE17AwakeFromLoadMode @ web_inc_rpg_devbuild.js:883092
    __ZN18AwakeFromLoadQueue28InvokePersistentManagerAwakeEPNS_4ItemEj17AwakeFromLoadMode @ web_inc_rpg_devbuild.js:1769592
    __ZN18AwakeFromLoadQueue30PersistentManagerAwakeFromLoadEv @ web_inc_rpg_devbuild.js:2721739
    __Z23CompletePreloadMainDataR18AwakeFromLoadQueue @ web_inc_rpg_devbuild.js:1649517
    __ZN18LoadLevelOperation19IntegrateMainThreadEv @ web_inc_rpg_devbuild.js:2222603
    __ZN14PreloadManager26UpdatePreloadingSingleStepEb @ web_inc_rpg_devbuild.js:1705903
    __ZN14PreloadManager35WaitForAllAsyncOperationsToCompleteEv @ web_inc_rpg_devbuild.js:3051953
    __Z20PlayerLoadFirstLevelv @ web_inc_rpg_devbuild.js:1347460
    _main @ web_inc_rpg_devbuild.js:903357
    asm._main @ web_inc_rpg_devbuild.js:3415332
    callMain @ web_inc_rpg_devbuild.js:3417426
    doRun @ web_inc_rpg_devbuild.js:3417462
    (anonymous function)

    If I'm not mistaken, the error seems to be coming from the Parse library that we're using. I guess I should consult their support then, but if you have any suggestions on how to resolve this, please tell me. Thank you very much.
     
  7. ironfiftynine

    ironfiftynine

    Joined:
    Jan 22, 2013
    Posts:
    71
    So I tried removing the Parse library for now. However, I got the following error stacktrace which points to the Xml functions.

    "jsStackTrace@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:875:12
    stackTrace@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:889:21
    ___cxa_throw@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:12286:14
    __ZN6il2cpp2vm9Exception5RaiseEP15Il2CppException [il2cpp::vm::Exception::Raise(Il2CppException?*)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:1853359:3
    __ZL9CastclassP8Object_tP8TypeInfo54257 [Castclass?4(TypeInfo?5?**)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2107452:2
    __Z27XmlNode_InsertBefore_m12894P13XmlNode_t1023S0_S0_bbP10MethodInfo [XmlNode_InsertBefore_m12894?0(XmlNode_t1023?S?*)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:1053281:7
    __Z26XmlNode_AppendChild_m12889P13XmlNode_t1023S0_bP10MethodInfo [XmlNode_AppendChild_m12889?0(XmlNode_t1023?S?*)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2495181:7
    __Z31XmlDocument_ReadNodeCore_m12643P17XmlDocument_t1021P14XmlReader_t592P10MethodInfo [XmlDocument_ReadNodeCore_m12643(MethodInfo?***)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:505177:6
    __Z27XmlDocument_ReadNode_m12642P17XmlDocument_t1021P14XmlReader_t592P10MethodInfo [XmlDocument_ReadNode_m12642(MethodInfo?***)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:1982912:7
    __ZN16VirtFuncInvoker1IP13XmlNode_t1023P14XmlReader_t592E6InvokeEP10MethodInfoPvS3_ [void undefined<undefined?n?>?o? VirtFuncInvoker1<XmlReader_t592?**, undefined?6?>?k()]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2302498:7
    __Z23XmlDocument_Load_m12632P17XmlDocument_t1021P14XmlReader_t592P10MethodInfo [XmlDocument_Load_m12632(MethodInfo?***)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:1947063:8
    __ZN18VirtActionInvoker1IP14XmlReader_t592E6InvokeEP10MethodInfoPvS1_ [void undefined<undefined?n?>?o? VirtActionInvoker1<XmlReader_t592?*, undefined?6?>?k()]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2341923:2
    __Z25XmlDocument_LoadXml_m5514P17XmlDocument_t1021P8String_tP10MethodInfo [XmlDocument_LoadXml_m5514(MethodInfo?***)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:1908404:2
    __ZN18VirtActionInvoker1IP8String_tE6InvokeEP10MethodInfoPvS1_ [void undefined<undefined?n?>?o? VirtActionInvoker1<String_t?*, undefined?6?>?k()]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2354668:2
    __Z33AudioManager_ParseAudioList_m2570P17AudioManager_t495P8String_tP10MethodInfo [AudioManager_ParseAudioList_m2570(MethodInfo?***)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:959390:2
    __Z27SFXManager_ParseAudio_m2576P15SFXManager_t497P10MethodInfo [SFXManager_ParseAudio_m2576(MethodInfo?**)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2532339:2
    __Z34GameManager_InitAudioPlayers_m2808P16GameManager_t521P10MethodInfo [GameManager_InitAudioPlayers_m2808(MethodInfo?**)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2366105:2
    __Z23GameManager_Awake_m2796P16GameManager_t521P10MethodInfo [GameManager_Awake_m2796(MethodInfo?**)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2042901:2
    __Z22RuntimeInvoker_Void_t5P10MethodInfoPvPS1_ [RuntimeInvoker_Void_t5?1(void**, undefined?S?*)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2556626:2
    __ZN6il2cpp2vm7Runtime6InvokeEP10MethodInfoPvPS4_PP12Il2CppObject [il2cpp::vm::Runtime::Invoke?4(void**, undefined?S?*)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2488532:7
    _il2cpp_runtime_invoke@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2523909:7
    __Z20il2cpp_invoke_method21ScriptingMethodIl2CppP15ScriptingObjectP18ScriptingArgumentsPP18ScriptingExceptionb [il2cpp_invoke_method?2()]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2208486:8
    __ZN19ScriptingInvocation6InvokeEPP18ScriptingExceptionb [ScriptingInvocation::Invoke(bool**)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:1630443:7
    __ZN19ScriptingInvocation6InvokeEPP18ScriptingException [ScriptingInvocation::Invoke(ScriptingException?**)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2533169:7
    __ZN25ScriptingInvocationNoArgs13InvokeCheckedEv [ScriptingInvocationNoArgs::InvokeChecked()]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2338211:7
    __ZN13MonoBehaviour12AddToManagerEv [MonoBehaviour::AddToManager()]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:1199145:4
    __ZN9Behaviour13AwakeFromLoadE17AwakeFromLoadMode [Behaviour::AwakeFromLoad?1()]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2088832:4
    __ZN13MonoBehaviour13AwakeFromLoadE17AwakeFromLoadMode [MonoBehaviour::AwakeFromLoad?1()]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:860036:4
    __ZN18AwakeFromLoadQueue28InvokePersistentManagerAwakeEPNS_4ItemEj17AwakeFromLoadMode [AwakeFromLoadQueue::InvokePersistentManagerAwake?1(AwakeFromLoadQueue::Item*, unsigned int)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:1628697:4
    __ZN18AwakeFromLoadQueue30PersistentManagerAwakeFromLoadEv [AwakeFromLoadQueue::persistentManagerAwakeFromLoad()]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2192535:3
    __Z23CompletePreloadMainDataR18AwakeFromLoadQueue [CompletePreloadMainData(AwakeFromLoadQueue?&)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:1532284:2
    __ZN18LoadLevelOperation19IntegrateMainThreadEv [LoadLevelOperation::IntegrateMainThread()]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:1943113:3
    __ZN14PreloadManager26UpdatePreloadingSingleStepEb [PreloadManager::UpdatePreloadingSingleStep(bool)]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:1574053:2
    __ZN14PreloadManager35WaitForAllAsyncOperationsToCompleteEv [PreloadManager::WaitForAllAsyncOperationsToComplete()]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2394978:3
    __Z20PlayerLoadFirstLevelv [PlayerLoadFirstLevel()]@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:1272249:3
    _main@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:879299:2
    asm._main@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2622810:9
    callMain@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2624891:13
    doRun@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2624927:4
    run/<@http://localhost:8080/web_inc_rpg_devbuild/Development/web_inc_rpg_devbuild.js:2624937:4
    UnityErrorHandler@http://localhost:8080/web_inc_rpg_devbuild/Development/UnityConfig.js:104:5
    "

    I need to resolve this one seems I'm getting my data through xml files (assigned as TextAsset class members). Any suggestions on how to fix this? Thank you.