Possible WebGL Build Bug

Hey all!

Before I package up my project and officially try to report it as a bug, I figured I’d just do a quick sanity test and show you the error first.

This is from me trying to build using default WebGL settings. It appears to be searching the Project directory for UnityLoader.js.

I thought UnityLoader.js is supposed to be generated upon building, so I’m a bit confused.

If I create an empty text file called “UnityLoader.js” and place it in the folder it’s looking for, then the error no longer happens, but instead I get an error saying it’s looking for “uglify-js.” When I place ugilify-js in there, I get another error saying it’s looking for “…/tools/tty”

It seems like the WebGL module is somehow not configured properly and is looking for a bunch of js and python libs all in the wrong places. Could it be something I’ve done wrong? Should it be logged as a bug?

Forgot to mention this is in 2021.2.0a17

Hi –
I’m experiencing the same thing (already reported as Case 1336357). It does this with a completely empty project as well, and I have a suspicion the build throws these errors when your project folder is on a different drive than the Unity installation.

I have Unity on the D: drive – if I build a project “D:/New Unity Project”, it works; but building the same exact thing elsewhere, e.g. “E:/New Unity Project” or “C:/…/Desktop/New Unity Project” fails.
(Edit: After getting past these errors, it also seems to cause a similar problem when you use a jslib in the Plugins folder.)

Building for a different platform (I tried PC/Windows) in all these places works fine.

It seems your hunch was absolutely correct @Rallix !

After moving my project to C:/ (the same drive that my Unity installation is on), the build goes off without a hitch. The only problem is it’s now outside of my Perforce workspace directory:sweat_smile:

@Rallix Are you sure that’s the correct case number? I tried looking it up but nothing came up.

Hi @TheoTowers – sorry, I forgot to post the update here. It is the correct case number, and it’s on the public issue tracker now:

I don’t think the title they chose summarizes the problem very well; it’s just a custom package I sent as a repro project. The public description isn’t very detailed, but on FogBugz, I mentioned everything I said here and linked this thread, too.
Essentially it’s these two issues (regressions) with similar error messages:

  • WebGL build fails when the project is on a different drive than the Unity installation
Builds\Sample\Build\Sample.loader.js: ENOENT: no such file or directory, open 'F:\Unity\Wolfsbane\UnityLoader\UnityLoader.js'
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
  • WebGL build fails when the project contains a jslib plugin
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 'F:\Unity\Wolfsbane\Packages\com.custom.package\Runtime\
Plugins\WebGL\customPlugin.jslib'" | Error: ENOENT: no such file or
directory, open 'F:\Unity\Wolfsbane\Packages\com.custom.package\Runtime\
Plugins\WebGL\customPlugin.jslib'

Thanks @Rallix !! Much appreciated!!

I think I’m maybe not using the issue tracker properly because even though your direct link works, I still can’t find it by searching the number. Sorry, I’m kind of new to it!

Hi @TheoTowers ,
no news yet; I just noticed something similar (or the same) also seems to be reported as Case 1337929 in case you want to follow that issue as well.

Edit:
The QA Team replied that this is an internally-tracked, known issue “resulting from changes to the new incremental build system that have been resolved”.

@Rallix Thanks for the update! Glad to hear that it seems to be getting fixed