500 Internal Server Error When Publish to WebGL in Unity

Veröffentlicht am: 01 Dezember 2022
auf dem Kanal: DA LAB
1,945
16

Recently, I have been getting http/1.1 500 internal server error when I build and publish to WebGL in Unity. Sometimes the project builds and publishes to webGL successfully but only loads up to 90% online and then fails to work.
The code of my project contains web requests and download handlers.

There are different suggestions to fix the issue.
Restart Unity Editor and Unity Hub
Restart the PC
Change the player project settings
Not blocking WebRequest in the code. Get rid of while, if and other statements that may block the request.

I have tried all these suggestions. None seems to fix the issue.

The error is random. My project sometimes builds and publishes successfully to webGL, and sometimes I get the 500 internal server error.

This randomness may confuse a person about what solution would work. If the project randomly publishes successfully to the web, a person may think that the fix they tried is the right answer.

So, I thought, what if I keep trying to build and publish to WebGL over and over until the publishing is successful?

It worked eventually.

I still don’t understand the reason for that error, given 500 internal server error is general by nature. It could be a Unity bug or something else.

However, the repetitive trial of building and publishing to webGL seems a temporary fix.


Auf dieser Seite können Sie das Online-Video 500 Internal Server Error When Publish to WebGL in Unity mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer DA LAB 01 Dezember 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,945 Mal angesehen und es wurde von 16 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!