Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question analytics in webGL no go?

Discussion in 'Web' started by laurentlavigne, May 22, 2021.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,225
    i build and get this
    Code (CSharp):
    1. Building Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js failed with output:
    2. Internal compiler error in src/compiler.js! Please raise a bug report at https://github.com/kripken/emscripten/issues/ with a log of the build and the input files used to run. Exception message: "Error: ENOENT: no such file or directory, open 'Z:\ZombieMiner 2021\Packages\com.unity.analytics\Plugins\WindowUtil.jslib'" | Error: ENOENT: no such file or directory, open 'Z:\ZombieMiner 2021\Packages\com.unity.analytics\Plugins\WindowUtil.jslib'
    analytics not allowed because of browser security?

    weird it's not picked up at compile
     
  2. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    589
    Which Unity version?
     
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,225
  4. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    Hmm, can you elaborate on the point "weird it's not picked up at compile"? This error message should be a WebGL project compile time message.

    In any case, this is clearly a Unity bug. I see we had internal discussion about this just last week, and are now tracking this issue, and from what I can read in the bug database, it is marked as a regression that is currently happening only in the 2021.2 alpha builds. Are you sure you weren't on Unity 2021.2 alpha version? The first line "Library\Bee\artifacts\..." also suggests that this would have been made on 2021.2 alpha, since that "Bee" directory name should only exist in 2021.2 alpha, not on 2020.3.

    If you have this issue occurring on already released 2020.3 builds, we should treat this regression with priority. Can you detail exactly which Unity point release version you are using, and which earlier version still worked for you to do builds? Also, please open a bug report about this, whereas before we thought this was still an alpha release glitch, if this is actually a regression that has made its way to release, we want to make sure that we are on top of tracking the issue in the specific version where it broke.
     
  5. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,225
    I built it in 3 versions of unity to check which was better and one of them was much smaller so I kept it, lemme see... yep it's 2021.2 and not 2020.3
    you recommdn i use 2020.3 if i want analytics?
     
  6. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    Thanks for the testing, very much appreciated. Good to hear that the regression range matches our expectations, and doubly good to catch the regression while 2021.2 is still in Alpha, and way before release still.

    For smallest builds, I'll recommend the upcoming 2021.2 Beta, it should improve the compiler backend (and also fix that regression asap, as it is currently being worked on), and give a reduction in generated build sizes.

    Using 2020.3 should work great for analytics.
     
    laurentlavigne likes this.
  7. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,225
  8. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    Great, thank you for the bug report, that is most appreciated!
     
  9. janoonk

    janoonk

    Joined:
    Dec 3, 2008
    Posts:
    79
    I have this same issue with Unity 2021.2.0a17.2411
    I wanted to make a WebGL build, my exact same project did compile fine under 2021.1.0a9

    The folder "C:\Users\Jan Oonk\source\repos\Unity\ContainerVisualizer\Packages" does exist, but there a no subfolders so "C:\Users\Jan Oonk\source\repos\Unity\ContainerVisualizer\Packages\com.unity.analytics\Plugins\WindowUtil.jslib"
    does not exist.

    Complete error:
    Code (CSharp):
    1. Building Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js failed with output:
    2. Internal compiler error in src/compiler.js! Please raise a bug report at https://github.com/kripken/emscripten/issues/ with a log of the build and the input files used to run. Exception message: "Error: ENOENT: no such file or directory, open 'C:\Users\Jan Oonk\source\repos\Unity\ContainerVisualizer\Packages\com.unity.analytics\Plugins\WindowUtil.jslib'" | Error: ENOENT: no such file or directory, open 'C:\Users\Jan Oonk\source\repos\Unity\ContainerVisualizer\Packages\com.unity.analytics\Plugins\WindowUtil.jslib'
    3.     at Error (native)
    4.     at Object.fs.openSync (fs.js:640:18)
    5.     at Object.fs.readFileSync (fs.js:508:33)
    6.     at read (C:\Program Files\Unity\Hub\Editor\2021.2.0a17\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\src\compiler.js:57:34)
    7.     at Object.load (eval at globalEval (C:\Program Files\Unity\Hub\Editor\2021.2.0a17\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\src\compiler.js:105:8), <anonymous>:175:17)
    8.     at JSify (eval at globalEval (C:\Program Files\Unity\Hub\Editor\2021.2.0a17\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\src\compiler.js:105:8), <anonymous>:87:20)
    9.     at Object.<anonymous> (C:\Program Files\Unity\Hub\Editor\2021.2.0a17\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\src\compiler.js:221:3)
    10.     at Module._compile (module.js:570:32)
    11.     at Object.Module._extensions..js (module.js:579:10)
    12.     at Module.load (module.js:487:32)
    13. Traceback (most recent call last):
    14.   File "C:\Program Files\Unity\Hub\Editor\2021.2.0a17\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emcc.py", line 3063, in <module>
    15.     sys.exit(run())
    16.   File "C:\Program Files\Unity\Hub\Editor\2021.2.0a17\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emcc.py", line 1780, in run
    17.     final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)
    18.   File "C:\Program Files\Unity\Hub\Editor\2021.2.0a17\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\shared.py", line 2274, in emscripten
    19.     emscripten._main(cmdline)
    20.   File "C:\Program Files\Unity\Hub\Editor\2021.2.0a17\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten.py", line 2233, in _main
    21.     return temp_files.run_and_clean(lambda: main(
    22.   File "C:\Program Files\Unity\Hub\Editor\2021.2.0a17\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\tempfiles.py", line 93, in run_and_clean
    23.     return func()
    24.   File "C:\Program Files\Unity\Hub\Editor\2021.2.0a17\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten.py", line 2238, in <lambda>
    25.     DEBUG=DEBUG,
    26.   File "C:\Program Files\Unity\Hub\Editor\2021.2.0a17\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten.py", line 2164, in main
    27.     temp_files=temp_files, DEBUG=DEBUG)
    28.   File "C:\Program Files\Unity\Hub\Editor\2021.2.0a17\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten.py", line 86, in emscript
    29.     glue, forwarded_data = compiler_glue(metadata, libraries, compiler_engine, temp_files, DEBUG)
    30.   File "C:\Program Files\Unity\Hub\Editor\2021.2.0a17\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten.py", line 218, in compiler_glue
    31.     glue, forwarded_data = compile_settings(compiler_engine, libraries, temp_files)
    32.   File "C:\Program Files\Unity\Hub\Editor\2021.2.0a17\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten.py", line 541, in compile_settings
    33.     cwd=path_from_root('src'), error_limit=300)
    34.   File "C:\Program Files\Unity\Hub\Editor\2021.2.0a17\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\tools\jsrun.py", line 132, in run_js
    35.     raise Exception('Expected the command ' + str(command) + ' to finish with return code ' + str(assert_returncode) + ', but it returned with code ' + str(proc.returncode) + ' instead! Output: ' + str(ret)[:error_limit])
    36. Exception: Expected the command ['C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\Tools\\nodejs\\node.exe', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\Emscripten\\src\\compiler.js', 'C:\\Users\\JANOON~1\\AppData\\Local\\Temp\\tmp_u3p2y.txt', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Audio.js', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\case_1174367_workaround.js', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\case_1179945_workaround.js', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\case_1187965_workaround.js', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\case_1208971_workaround.js', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Cursor.js', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\dlopen.js', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Eval.js', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\FileSystem.js', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Logging.js', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Profiler.js', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\ScreenOrientation.js', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Sensor.js', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\SystemInfo.js', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\UnetWebSocket.js', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\Video.js', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\WebCam.js', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\lib\\WebRequest.js', 'C:\\Users\\Jan Oonk\\source\\repos\\Unity\\ContainerVisualizer\\Assets\\Scripts\\JS\\jsLibrary.jslib', 'C:\\Users\\Jan Oonk\\source\\repos\\Unity\\ContainerVisualizer\\Packages\\com.unity.analytics\\Plugins\\WindowUtil.jslib', 'C:\\Program Files\\Unity\\Hub\\Editor\\2021.2.0a17\\Editor\\Data\\PlaybackEngines\\WebGLSupport\\BuildTools\\Emscripten\\src\\library_pthread_stub.js'] to finish with return code 0, but it returned with code 1 instead! Output: // The Module object: Our interface to the outside world. We import
    37. // and export values on it. There are various ways Module can be used:
    38. // 1. Not defined. We create it here
    39. // 2. A function parameter, function(Module) { ..generated code.. }
    40. // 3. pre-run appended it, var Module = {}; ..generated
    41. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    42.  
     
  10. janoonk

    janoonk

    Joined:
    Dec 3, 2008
    Posts:
    79
    Well I just removed the Analytics package since I don't use it. Now building works.
    Inside Unity goto Window > Package Manager > search for "com.unity.analytics" and click on Remove.
    Now you can build again.
     
  11. Jamacanufo

    Jamacanufo

    Joined:
    Aug 9, 2017
    Posts:
    1
    Hello - looks like we're seeing this issue too in Unity 2021.2.0b1.3029 - Can't seem to build for WebGL, failing with error:


    Building Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js failed with output:
    emcc:WARNING: --llvm-lto ignored when using llvm backend
    emcc2: error: '--js-library': file not found: 'Packages/com.unity.analytics/Plugins/WindowUtil.jslib'
    UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)


    Wondering if this is related - are we not able to build with analytics for WebGL? Is there a workaround?

    Thanks in advance for any assistance.
     
  12. unityruba

    unityruba

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    264
    tonialatalo and De-Panther like this.