Search Unity

Unity 2020.1 - Invalid or unexpected token error from compressed framework.js file

Discussion in 'Web' started by GameArter, Mar 3, 2020.

  1. GameArter

    GameArter

    Joined:
    Apr 16, 2015
    Posts:
    7
    Hello,

    Do exports using compressions (gzip / brotli) work after upload on a server for anyone?

    I have just tested it on 3 various servers (using nginx / apache, with cloudfale, without it, with various compression configuration) and received the same error - "Uncaught SyntaxError: Invalid or unexpected token" going from framework.js.br / framework.js.gz file in all attempts (there were downloaded new files on every attempt - I was aware to avoid loading from the cache).

    When it worked for me:
    Launch on localhost (Build and run option) and launch of unity build with disabled compression on the same servers was ok - the build loaded as expected.

    I am sure that the issue is related to the compression. However, I have had no problem with builds made in previous Unity versions which were also using compression and even similar structure of files. Detecting certain issue is quite complicated when I have not found no place when it would work for me, thus I am interested whether it is some problem on my side or a general problem in alpha version of the unity.

    Please, share your experience with me - whether builds work for you or you face the same problem..

    NOTE: I tested a build with 1 empty scene
     
    Last edited: Mar 3, 2020
  2. AlexFCL

    AlexFCL

    Joined:
    Mar 27, 2013
    Posts:
    18
    I am encountering the same issue with Unity3d 2020.1 beta Webgl builds with compression turned on (gz).

    Using Build & Run from Unity3D, it works with both compression turned on/off.

    I run my own iis server and can verify that:
    - Build with compression turned off run with no problem in the browsers.
    - Build with compression turned on will encounter the issue described above.
     

    Attached Files:

    iwanPlays likes this.
  3. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    826
    ina likes this.
  4. iwanPlays

    iwanPlays

    Joined:
    Feb 28, 2017
    Posts:
    5