Build Errors on WebGL

Hey guys!

So I need your help, I have just tried to Build my Terminal Hacker project and it keeps throwing errors and failing.

Here’s what I’ve tried:

  • Restarting the software
  • Reinstalling WebGL Suport
  • Erasing the library folder and having unity build it again
  • Changing stack in the emscripten.config folder to 1024
  • Reinstalling Unity

Do you guys have any clue what this might be?

Below is the printed screen from the error:

Thanks a lot!
Edit 1: I have also realized that the builder spends an awful lot of time in this item:

Edit 2: I have tested the build on my notebook and it worked with the same project, that just makes no sense, please help!

2 Likes

Hi,

It may not be related, but the path that you are building to is incredibly long and contains a mixture of characters which I would typically avoid.

You have mentioned that it built on your notepad, so that’s a good thing, often build issues with WebGL are caused by the downloading/installation of the WebGL component separately to the main Unity installation. Often people grab an incompatible version.

So, first question, when you installed Unity, did you select WebGL during the installation, or, did you download it separately afterwards and install it?

Hey Rob!

I’ll try changing the path to the root of C: (using only latin characters) once I get home today, just to make sure.

Yes, I did install WebGL separately, through the link that Unity gives, but I did the same thing on my laptop and it worked.

But, I also uninstalled Unity and reinstalled it, with the WebGL box checked, and the problem persisted.

hmm…

I would lean more towards the separate install of WebGL as being the issue personally, as pretty much everyone I’ve seen on here having a problem has had that scenary, e.g. where it has been installed separately.

If you have the time, then I would suggest removing your Unity installation from the notebook again, double check everything has gone, e.g. there aren’t any unity directories left over etc. Then re-install, select the option and make sure that the short cut icon that is created is pointing to the path where you installed it, e.g. it’s not a left-over pointing to another version or anything like that. Worst case, browse to the install directory and launch Unity from there.

The path is possible, but as you’ve had it working else where I’d suggest probably not the case. Older version of Visual Studio for example had a maximum length for the path for a project, if it was created from within Visual Studio, so creating projects in a C:\Users\someone… directory was/is typically bad. Personally I tend to have a E:\Dev\ directory, followed by the name of the project. I also avoid spaces and any special characters in the path name.

Thanks rob!

I’ll uninstall Unity, check for any left over files, and try installing it again (with the WebGL box checked) and see what happens.

If that doesn’t work I’ll put the project folder on C: and then get back to you with what happened!

1 Like

Ok, sure…

Out of interest, are the two different machines you are using running different OS?

Yes, bob, the Laptop is Win 10 Home (Works), and the PC is Win 10 Pro (Build problems).
Any ideas?

Have you done the clear down and re-install now on the PC, or is that still to happen?

Normally comes down to having an incompatible WebGL package installed for the version of Unity.

Again, out of curiosity, is there anything configured differently with either of these regarding locale/language settings?

I note the error message in your first screenshot is unhappy about the path, just wondering if again any of these more specific characters might be an issue. But if that was the case, I would expect to see a difference in the path on the working machine. That said, you probably are not using the same path on both machines are you?

I have just done the clear down and am about to reinstall!

image

I have just checked and both machines have same language and locale.

I am not using the same path for the project folders, but both had spaces and hifens “-” in them, I thought C# Written on the path could be the problem and removed it but nothing changed on the error.

Regarding the installation on the machines, I did both of them in the default location, no changes.

image

Try running Unity as an Administrator on the machine that is failing to build and see if you get any further error details or different error details.

I would atronfly suggest just creating a c:\dev\project structure and when you build use something like c:\builds\project.

Try also without any spaces in the path name at all.

Rob, here’s what I got after a fresh install, with WebGL option enabled on instalation folder:

Idk if this’ll help but I can build .EXE standalone files just fine:
image

And here’s the result after removing all spaces and non latin characters, aswell as placing the project folder straight on a C: folder
image

SO IT WORKS! Thanks a lot for your patience, Rob!

I won’t be marking this as solved for now because I’ll now try and figure out which of the variables was the one that created this error, after that I’ll post the lessons learned here and at the Udemy Q&A!

Below you can find the image of the error I faced:
https://community.gamedev.tv/uploads/short-url/ic4VGvE8wC9N4GNLwvQdPOkaHXq.png

For the solution part:
So, after a few hours analyzing the problem, here’s what I found out:
1- Reinstalling did not solve these errors;
2- Separate install of WebGL build tool was not the problem;
3- Spaces and numbers in the directory’s names have no impact on the WebGL Build process;
4- Path length was not a problem (on my project), as I kept my files on the Desktop and the build ran fine;

THEN WHAT DID YOU FIND OUT?
I found out that two things will freeze the WebGL builder:
1- Non-english characters, such as “ç”, a letter used a lot in portuguese.
2- Using accents on letters, such as “á”, “à”, “ã”, etc.

ANYTHING ELSE?
Yes, this only happens on the WebGL compiler, the Win/Lin/Mac Standalone compiler has no issues with these kind of characters.

I hope this information can help people in the future, I decided to be this thorough in my explanation because everything I found online was only half answers and that got me MAD, so here you go :slight_smile:

Thank you very much for your help, Rob, nice team work!

3 Likes

Great write up of your analysis, I’m sure this will be beneficial to others going forward, thank you.

I suspect the non-english characters are perhaps an issues because when the game is run on the web they would need to be URL encoded perhaps, where-as locally, this wouldn’t be an issue. Not sure, might see if I can find out any more on that.

Thanks again for a great write up and you’re welcome :slight_smile:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms