Forum rules - please read before posting.

Export to html5 problem - Maximum call stack size exeeded.

Hello,

Im a really new to this, trying to learn AC (with latest version of Unity), i have created a simple scene with simple functions that i would like to use as html5 for web.
I did build it for Windows and it worked fine, i tried to build it for html5, but i get error message, using XAMPP for local server.

It seems that it calls for a function but cant end it, thats what i learned from google, but i dont know how to solve it, since i just create everything without knowing any coding or c#. Would be so happy if someone could help me, someone who understands more than me! What can i do to get it work online?

The game loads to 90% and then nothing happens, i get this error later on screen:
RangeError: Maximum call stack size exeeded
at invoke_iii (http://localhost/showroomhtml/Build/showroomhtml.framework.js:17002:20)
at
_MainCamera_SetCameraRect_mxxxxx(:wasm-function[45974]:0xf8fc7e)

---- AND BELOW THIS IS FROM CHROME CONSOLE -----

exception thrown: RangeError: Maximum call stack size exceeded,RangeError: Maximum call stack size exceeded
at invoke_iii (http://localhost/showroomhtml/Build/showroomhtml.framework.js:17002:20)
at _MainCamera_SetCameraRect_m8982AD0EB76697CA1BAD28284F6BD320FADD887D (:wasm-function[45974]:0xf8fc7e)
at _MainCamera_RecalculateRects_mBB2BBF5D40E815E66DFDA9ACAC477FD03EEECB95 (:wasm-function[45966]:0xf8e6e7)
at _MainCamera_GetPlayableScreenArea_mB9E18E0279A433BD02C1DDF6F39B8EE95F5A760D (:wasm-function[45976]:0xf8ffb7)
at _MainCamera_CalculateUnityUIAspectRatioCorrection_mE2586CA41E9C5712001BB3C430A4B7F2B86AF77C (:wasm-function[45975]:0xf8fe05)
at _MainCamera_RecalculateRects_mBB2BBF5D40E815E66DFDA9ACAC477FD03EEECB95 (:wasm-function[45966]:0xf8e6ef)
at _MainCamera_GetPlayableScreenArea_mB9E18E0279A433BD02C1DDF6F39B8EE95F5A760D (:wasm-function[45976]:0xf8ffb7)
at _MainCamera_CalculateUnityUIAspectRatioCorrection_mE2586CA41E9C5712001BB3C430A4B7F2B86AF77C (:wasm-function[45975]:0xf8fe05)
at _MainCamera_RecalculateRects_mBB2BBF5D40E815E66DFDA9ACAC477FD03EEECB95 (:wasm-function[45966]:0xf8e6ef)
at _MainCamera_GetPlayableScreenArea_mB9E18E0279A433BD02C1DDF6F39B8EE95F5A760D (:wasm-function[45976]:0xf8ffb7)
at _MainCamera_CalculateUnityUIAspectRatioCorrection_mE2586CA41E9C5712001BB3C430A4B7F2B86AF77C (:wasm-function[45975]:0xf8fe05)
at _MainCamera_RecalculateRects_mBB2BBF5D40E815E66DFDA9ACAC477FD03EEECB95 (:wasm-function[45966]:0xf8e6ef)
at _MainCamera_GetPlayableScreenArea_mB9E18E0279A433BD02C1DDF6F39B8EE95F5A760D (:wasm-function[45976]:0xf8ffb7)
at _MainCamera_CalculateUnityUIAspectRatioCorrection_mE2586CA41E9C5712001BB3C430A4B7F2B86AF77C (:wasm-function[45975]:0xf8fe05)
at _MainCamera_RecalculateRects_mBB2BBF5D40E815E66DFDA9ACAC477FD03EEECB95 (:wasm-function[45966]:0xf8e6ef)
at _MainCamera_GetPlayableScreenArea_mB9E18E0279A433BD02C1DDF6F39B8EE95F5A760D (:wasm-function[45976]:0xf8ffb7)
at _MainCamera_CalculateUnityUIAspectRatioCorrection_mE2586CA41E9C5712001BB3C430A4B7F2B86AF77C (:wasm-function[45975]:0xf8fe05)
at _MainCamera_RecalculateRects_mBB2BBF5D40E815E66DFDA9ACAC477FD03EEECB95 (:wasm-function[45966]:0xf8e6ef)
at _MainCamera_GetPlayableScreenArea_mB9E18E0279A433BD02C1DDF6F39B8EE95F5A760D (:wasm-function[45976]:0xf8ffb7)
at _MainCamera_CalculateUnityUIAspectRatioCorrection_mE2586CA41E9C5712001BB3C430A4B7F2B86AF77C (:wasm-function[45975]:0xf8fe05)
at _MainCamera_RecalculateRects_mBB2BBF5D40E815E66DFDA9ACAC477FD03EEECB95 (:wasm-function[45966]:0xf8e6ef)
at _MainCamera_GetPlayableScreenArea_mB9E18E0279A433BD02C1DDF6F39B8EE95F5A760D (:wasm-function[45976]:0xf8ffb7)
at _MainCamera_CalculateUnityUIAspectRatioCorrection_mE2586CA41E9C5712001BB3C430A4B7F2B86AF77C (:wasm-function[45975]:0xf8fe05)
at _MainCamera_RecalculateRects_mBB2BBF5D40E815E66DFDA9ACAC477FD03EEECB95 (:wasm-function[45966]:0xf8e6ef)
at _MainCamera_GetPlayableScreenArea_mB9E18E0279A433BD02C1DDF6F39B8EE95F5A760D (:wasm-function[45976]:0xf8ffb7)
at _MainCamera_CalculateUnityUIAspectRatioCorrection_mE2586CA41E9C5712001BB3C430A4B7F2B86AF77C (:wasm-function[45975]:0xf8fe05)
at _MainCamera_RecalculateRects_mBB2BBF5D40E815E66DFDA9ACAC477FD03EEECB95 (:wasm-function[45966]:0xf8e6ef)
at _MainCamera_GetPlayableScreenArea_mB9E18E0279A433BD02C1DDF6F39B8EE95F5A760D (:wasm-function[45976]:0xf8ffb7)
at _MainCamera_CalculateUnityUIAspectRatioCorrection_mE2586CA41E9C5712001BB3C430A4B7F2B86AF77C (:wasm-function[45975]:0xf8fe05)
at _MainCamera_RecalculateRects_mBB2BBF5D40E815E66DFDA9ACAC477FD03EEECB95 (:wasm-function[45966]:0xf8e6ef)
at _MainCamera_GetPlayableScreenArea_mB9E18E0279A433BD02C1DDF6F39B8EE95F5A760D (:wasm-function[45976]:0xf8ffb7)
at _MainCamera_CalculateUnityUIAspectRatioCorrection_mE2586CA41E9C5712001BB3C430A4B7F2B86AF77C (:wasm-function[45975]:0xf8fe05)
at _MainCamera_RecalculateRects_mBB2BBF5D40E815E66DFDA9ACAC477FD03EEECB95 (:wasm-function[45966]:0xf8e6ef)
at _MainCamera_GetPlayableScreenArea_mB9E18E0279A433BD02C1DDF6F39B8EE95F5A760D (:wasm-function[45976]:0xf8ffb7)
at _MainCamera_CalculateUnityUIAspectRatioCorrection_mE2586CA41E9C5712001BB3C430A4B7F2B86AF77C (:wasm-function[45975]:0xf8fe05)
at _MainCamera_RecalculateRects_mBB2BBF5D40E815E66DFDA9ACAC477FD03EEECB95 (:wasm-function[45966]:0xf8e6ef)
at _MainCamera_GetPlayableScreenArea_mB9E18E0279A433BD02C1DDF6F39B8EE95F5A760D (:wasm-function[45976]:0xf8ffb7)
at _MainCamera_CalculateUnityUIAspectRatioCorrection_mE2586CA41E9C5712001BB3C430A4B7F2B86AF77C (:wasm-function[45975]:0xf8fe05)
at _MainCamera_RecalculateRects_mBB2BBF5D40E815E66DFDA9ACAC477FD03EEECB95 (:wasm-function[45966]:0xf8e6ef)
at _MainCamera_GetPlayableScreenArea_mB9E18E0279A433BD02C1DDF6F39B8EE95F5A760D (:wasm-function[45976]:0xf8ffb7)
at _MainCamera_CalculateUnityUIAspectRatioCorrection_mE2586CA41E9C5712001BB3C430A4B7F2B86AF77C (:wasm-function[45975]:0xf8fe05)
at _MainCamera_RecalculateRects_mBB2BBF5D40E815E66DFDA9ACAC477FD03EEECB95 (:wasm-function[45966]:0xf8e6ef)
at _MainCamera_GetPlayableScreenArea_mB9E18E0279A433BD02C1DDF6F39B8EE95F5A760D (:wasm-function[45976]:0xf8ffb7)
at _MainCamera_CalculateUnityUIAspectRatioCorrection_mE2586CA41E9C5712001BB3C430A4B7F2B86AF77C (:wasm-function[45975]:0xf8fe05)
at _MainCamera_RecalculateRects_mBB2BBF5D40E815E66DFDA9ACAC477FD03EEECB95 (:wasm-function[45966]:0xf8e6ef)
at _MainCamera_GetPlayableScreenArea_mB9E18E0279A433BD02C1DDF6F39B8EE95F5A760D (:wasm-function[45976]:0xf8ffb7)
at _MainCamera_CalculateUnityUIAspectRatioCorrection_mE2586CA41E9C5712001BB3C430A4B7F2B86AF77C (:wasm-function[45975]:0xf8fe05)
at _MainCamera_RecalculateRects_mBB2BBF5D40E815E66DFDA9ACAC477FD03EEECB95 (:wasm-function[45966]:0xf8e6ef)
at _MainCamera_GetPlayableScreenArea_mB9E18E0279A433BD02C1DDF6F39B8EE95F5A760D (:wasm-function[45976]:0xf8ffb7)
at _MainCamera_CalculateUnityUIAspectRatioCorrection_mE2586CA41E9C5712001BB3C430A4B7F2B86AF77C (:wasm-function[45975]:0xf8fe05)
printErr @ /showroomhtml/Build/showroomhtml.loader.js:31

Comments

  • edited September 2020

    Please anyone? Maybe it is AC that has this bug when building for html5 with the latest version of Unity (2020.1.4f1).

    It may be a bug, i found this post relating to same issue, some project settings seems to be the issue, but how to find it..

    https://adventurecreator.org/forum/discussion/10524/errors-after-exporting-to-webgl#latest

  • edited September 2020

    Welcome to the community, @AC_Student.

    What version of AC are you using, and what browser are you loading the build from?

    The issue looks like it could be that Unity's Screen.safeArea function is returning empty values.

    As this may indeed be similar to that other thread, the solution may lie in your Player settings. Please share your "Edit -> Project -> Player settings" window details, and try enabling the caching that I suggested there.

  • edited September 2020

    Hello,

    And thank you for response,

    I use v.1.71.8 and i have tried Firefox, Chrome, Edge!

    And i attach 3 images for my settings, already have caching enabled.

    Thank you

  • Thanks.

    It's too early to say exactly where the issue lies, but I will use these to attempt a recreation.

  • Thank you so much, i cant explain how much i appreciate this, all my projects i have in my mind to create with this amazing tool is for online use and educational at the same time! You dont know how much this project means to me, i have made some test for all stages and im happy with everything, this is the last part of the test and im stuck as you noticed =)

  • Open up MainCamera.cs, and replace the line:

    if (playableScreenRect.width == 0) RecalculateRects ();
    

    with:

    #if UNITY_WEBGL && !UNITY_EDITOR
    if (playableScreenRect.width == 0 && Time.time > 0f) RecalculateRects ();
    #else
    if (playableScreenRect.width == 0) RecalculateRects ();
    #endif
    
  • You are the best Chris, thank you so much!

    While that was fixed, and the game pops up, the dev console gives me warning that is ticking up every second, while im writing now its up to 133 warning, the error message is:
    The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page.

    Is there a quickfix to this?

    Last question is, i have created Pickup item, its a book that i can pick up and rotate now thanks to the turtorials, but sometimes or most often, when i click to lift the object, it acts like its picking it up to inventory, but there is nothing there and the object is just gone. Is picking up conflicting with the add to inventory function?

    Thank you so much

  • The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page.

    This is in Chrome?

    It looks to be a behaviour of the browser, rather than anything AC is doing. See this thread for an explanation and solution.

    Is picking up conflicting with the add to inventory function?

    Where is the object moving to, if you pause the game and select it in the Hierarchy / view it in the Scene Manager? The PickUp and Inventory systems are separate, so I would need to know how you're calling such an Action.

    As this is a separate issue, please create a new thread for this - along with as many details as you can provide.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.