Search Unity

WebGL error while running in localhost.

Discussion in 'Web' started by Snapdonedev, Jul 24, 2020.

  1. Snapdonedev

    Snapdonedev

    Joined:
    Jul 24, 2017
    Posts:
    19
    Took a webgl build in unity 2019.4 with gzip compression and webassembly streaming enabled. When I run the build in local host the following error shown. check screenshot below. Capture.JPG Capture.JPG
     
  2. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,555
    Your first error relates to MIME type, so if you haven't seen this already maybe it's helpful:
    https://docs.unity3d.com/Manual/webgl-deploying.html

    "For WebAssembly streaming compilation to work, the server needs to return .wasm with an application/wasm MIME type."
     
  3. Snapdonedev

    Snapdonedev

    Joined:
    Jul 24, 2017
    Posts:
    19
    First, thank you for your reply.
    I have gone through the unity manual, as like I added .htaccess file into the build folder and I got the following error.
    the screenshot of error, build files, .htaccess file given below .
     

    Attached Files:

  4. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,555
    I don't know much about this kind of thing to be helpful. I can only suggest you try getting it working with compression turned off first. That way the potential causes are narrowed down a bit - also if there's a "decompression fallback" option in your version of the editor you could try that along with compression. You could also try restarting your web services or system if there's been changes that weren't applied as expected there's a chance that'll help.
     
  5. Snapdonedev

    Snapdonedev

    Joined:
    Jul 24, 2017
    Posts:
    19
    OK thnks. actually my actual problem is webgl loading time. my build is about 28mb, I have internet speed about nearly 50Mbps even if its it took more than 10sec to the build into the browser(I checked browser console). do you have any idea about it. is there any limitation in unity personal version ?
     
  6. desanidemo

    desanidemo

    Joined:
    Oct 15, 2020
    Posts:
    2
    Hi, Do you get any solution?