Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Load crashes on 2017.3 and 2018.1beta

Discussion in 'WebGL' started by fklingler-mitm, Jan 30, 2018.

  1. fklingler-mitm

    fklingler-mitm

    Joined:
    Mar 7, 2017
    Posts:
    12
    Hi,

    Our application is currently built on 2017.1. I wanted to upgrade to 2017.3 and 2018.1b4 to test the apparently amazing performances changes that have been released in these versions for WebGL.
    I mainly just imported the project in these versions, fixing the little errors due to some API changes. The project obviously worked great on 2017.1.

    Unfortunately, the application built with these versions just crash at the load time.

    These have been tested with Chrome and Firefox, getting the same errors. I also get the same errors whether I do a development build or not. The following crash logs have been copied from the development builds to get better symbols, and with a prettified UnityLoader.js.

    On 2017.3, ASM build (but I tested on WASM and we get the same thing), we have this:
    Uncaught RangeError: Offset is outside the bounds of the DataView
    at DataView.getUint32 (<anonymous>)
    at processDataJob (http://localhost:8000/UnityLoader.js:88:19)
    at a.callback (http://localhost:8000/UnityLoader.js:429:50)
    at ZoneDelegate.invokeTask (webpack-internal:///699:365:31)
    at Zone.runTask (webpack-internal:///699:165:47)
    at ZoneTask.invoke (webpack-internal:///699:418:38)
    at data.args.(anonymous function) (webpack-internal:///699:1579:29)
    processDataJob @ UnityLoader.js:88
    a.callback @ UnityLoader.js:429
    ZoneDelegate.invokeTask @ zone.js?6524:365
    Zone.runTask @ zone.js?6524:165
    ZoneTask.invoke @ zone.js?6524:418
    data.args.(anonymous function) @ zone.js?6524:1579
    setTimeout (async)
    scheduleTask @ zone.js?6524:1585
    ZoneDelegate.scheduleTask @ zone.js?6524:351
    Zone.scheduleTask @ zone.js?6524:196
    Zone.scheduleMacroTask @ zone.js?6524:210
    (anonymous) @ zone.js?6524:1603
    setTimeout @ VM444:3
    schedule @ UnityLoader.js:452
    (anonymous) @ UnityLoader.js:138
    callRuntimeCallbacks @ blob:http://localhost:9001/4a543f91-7e99-4c2b-80c7-e85c75abfe09:2
    preRun @ blob:http://localhost:9001/4a543f91-7e99-4c2b-80c7-e85c75abfe09:2
    run @ blob:http://localhost:9001/4a543f91-7e99-4c2b-80c7-e85c75abfe09:4
    runCaller @ blob:http://localhost:9001/4a543f91-7e99-4c2b-80c7-e85c75abfe09:4
    removeRunDependency @ blob:http://localhost:9001/4a543f91-7e99-4c2b-80c7-e85c75abfe09:2
    applyMemoryInitializer @ blob:http://localhost:9001/4a543f91-7e99-4c2b-80c7-e85c75abfe09:4
    useRequest @ blob:http://localhost:9001/4a543f91-7e99-4c2b-80c7-e85c75abfe09:4
    ZoneDelegate.invokeTask @ zone.js?6524:365
    Zone.runTask @ zone.js?6524:165
    ZoneTask.invoke @ zone.js?6524:418
    data.args.(anonymous function) @ zone.js?6524:1579
    setTimeout (async)
    scheduleTask @ zone.js?6524:1585
    ZoneDelegate.scheduleTask @ zone.js?6524:351
    Zone.scheduleTask @ zone.js?6524:196
    Zone.scheduleMacroTask @ zone.js?6524:210
    (anonymous) @ zone.js?6524:1603
    setTimeout @ VM444:3
    UnityLoader.1f661f20676ce250ea9d5f342f41749b @ blob:http://localhost:9001/4a543f91-7e99-4c2b-80c7-e85c75abfe09:4
    UnityLoader.loadCode.Module @ UnityLoader.js:72
    o.onload @ UnityLoader.js:24
    wrapFn @ zone.js?6524:1240
    ZoneDelegate.invokeTask @ zone.js?6524:365
    Zone.runTask @ zone.js?6524:165
    ZoneTask.invoke @ zone.js?6524:418

    On 2018.1b4, we have this:
    Invoking error handler due to
    Uncaught SyntaxError: Unexpected end of input
    blob:http://localhost:9001/d38728ef-8e6a-447d-8fc8-968e8c985070:1 Uncaught SyntaxError: Unexpected end of input
    UnityLoader.js:1798 Invoking error handler due to
    Uncaught SyntaxError: Unexpected end of input
    blob:http://localhost:9001/c7c2dfcd-f1b1-4699-bdc0-4c10a06ed568:1 Uncaught SyntaxError: Unexpected end of input
    UnityLoader.js:1798 Invoking error handler due to
    Script error.
    zone.js?6524:169 Uncaught TypeError: UnityLoader[r] is not a function
    at UnityLoader.loadCode.Module (UnityLoader.js:2149)
    at HTMLScriptElement.o.onload (UnityLoader.js:2078)
    at HTMLScriptElement.wrapFn [as __zone_symbol___onload] (zone.js?6524:1240)
    at ZoneDelegate.invokeTask (zone.js?6524:365)
    at Zone.runTask (zone.js?6524:165)
    at HTMLScriptElement.ZoneTask.invoke (zone.js?6524:418)
    This error is inside the `processAsmFrameworkJob` function.

    Have you any idea what may cause this?

    Also weird thing to note, that may be completely unrelated (but I would gladly have some infos about that even if it's unrelated), my build size significantly grew. On 2017.1, the .data.unityweb file was 11186Ko, on 2017.3 it's 14466Ko, and on 2018.1beta it's 14543Ko. Other build files were approximately the same size.
    What could be the reason for that?


    Thanks for your help,

    François
     
  2. fklingler-mitm

    fklingler-mitm

    Joined:
    Mar 7, 2017
    Posts:
    12
    I've finally found what caused this!

    This is a weird combinaison of two things:
    • I used https://github.com/jpillora/xhook in the project that integrated my WebGL app. If I disable it, no crash.
    • I added the UnityLoader script dynamically, like that:
    Code (JavaScript):
    1.  
    2.         const scriptUnityLoader = document.createElement('script');
    3.         scriptUnityLoader.src = '/Build/UnityLoader.js';
    4.         document.body.appendChild(scriptUnityLoader);
    5.  
    6.         const jsonUrl = '/Build/unity-versions-2017.3-dev.json';
    7.  
    8.         scriptUnityLoader.onload = () => {
    9.             window.UnityLoader.instantiate('gameContainer', jsonUrl);
    10.         };
    11.  
    If I load the script directly with the <script> tag in the HTML file, no problem either.

    I don't really understand how this combinaison is not working, but whatever.
    The good thing is I used xhook to intercept the XHR queries created by UnityLoader, to get the download progress of the unityweb files. But the progress provided by UnityLoader directly has apparently been fixed since! So I can simply remove the xhook dependency and go on :)
     
  3. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    140
    Thanks for posting the update though.
     
  4. CengageJermAker

    CengageJermAker

    Joined:
    Nov 29, 2017
    Posts:
    9
    You can also get this Uncaught RangeError: Offset is outside the bounds of the DataView at DataView.getUint32 (<anonymous>) if your server is running Dynatrace as the JavaScript injected by Dynatrace does some bad things with UnityLoader.js.
     
  5. hrishikesh2416

    hrishikesh2416

    Joined:
    Jan 16, 2019
    Posts:
    2
    We are seeing issues on our unity loader.js. We have been using Dynatrace App monitor version 7. Has anyone encountered this before?
     
  6. motherlove

    motherlove

    Joined:
    Oct 29, 2018
    Posts:
    1
    How can one get around that?
     
  7. Anderw_Mad

    Anderw_Mad

    Joined:
    Feb 17, 2017
    Posts:
    2
    2018.3 The same error now ...(( When it's healing?
     
  8. MrEdens

    MrEdens

    Joined:
    Sep 1, 2016
    Posts:
    2
    Is there an easy fix for this? Hosting on 000Webhost and the game just locks up on all browsers. I can load the game if I first upload to something like simmer.io but that is not preferable.
     
    aRCHmage333 likes this.
  9. aRCHmage333

    aRCHmage333

    Joined:
    Nov 27, 2016
    Posts:
    12
    I uploaded 2 versions of my prototype to 000webhost as well. They worked.

    The 3rd version has this error and hence, doesn't work.

    I don't do HTML code, I just want to build with Unity and upload to web.

    How to fix this?
     
  10. aRCHmage333

    aRCHmage333

    Joined:
    Nov 27, 2016
    Posts:
    12
    I figured out that in my case, if I remove the audio source (mp3 soundtrack) from the game, the WebGL build works again. So, Unity builds some glitchy thing in that is related to sound.

    I think this is a fairly major issue and I hope someone finds a reliable workaround / fix for it until it's fully resolved and removed.