Unity WebGl build is working in unity, but not working on the server - unity3d

When I build and run as webgl in unity it works perfectly (on local server), however when I upload it to my server, and try to run it, I get the following error:
Unable to load file Build/web_gl_3.framework.js.gz! Check that the file exists on the remote server. (also check browser Console and Devtools Network tab to debug).
I have checked that the file does exist on the server, however it is encrypted so I cannot troubleshoot the code much (it is automatically generated by Unity in the webgl build folder anyway).
In the console it says:
Refused to execute script from 'https:[private_info]/Build/web_gl_4.framework.js.gz' because its MIME type ('application/x-gzip') is not executable, and strict MIME type checking is enabled.
How can I resolve this error?

Related

Unity-WebGL showing grey window instead of interactive website

I have a Unity project, where you can navigate around in a 3D space environment. I'm using Unity version 2020.3.4f1 Personal. I went to 'Build settings', chose WebGL, and then clicked 'Build And Run.
The project seems to launch on a Chrome browser in localhost, without any issues:
However, when I zip the build files & folders (index.html file along with the 'Build' and 'StreamingAssets'), then host as a website, all I get is a grey screen, instead of an interactive website!
As mentioned the build created is - index.html file, 'Build' folder, and 'StreamingAssets' folder:
Clearly, there's something wrong with the build as the project seems to run fine directly in localhost.
Any help would be really appreciated.
Many thanks
Edit
Looking at the logs in the Chrome browser console (running on localhost), these are the logs:
For the 404 error, I found some Unity forum thread: https://forum.unity.com/threads/webgl-builds-only-partially-working.357591/ , where I then thought the solution was to enable Data Caching & Decompression Fallback, and set Compression Format Gzip.
But this didn't solve the issue, as I still get the 404 in the console log, running on localhost (although as mentioned before, in localhost it runs). Also, when hosting it on a server using Netlify it still shows just a Grey window.
Note: strangely when I refresh the browser running localhost, the 404 disappears, but still the main thing is that when hosted on a remote server (Netlify), I just get a Grey window.
Localhost will be case-insensitive on Windows, while Linux is usually case sensitive on the Host. Check URLs and file names, and try looking at the Web server logs for 404 errors.

Can't run published Blazor WebAssembly app

The app works just fine when I run it in the Visual Studio debugger, but if I deploy it to a server I get this error in the browser console:
Failed to find a valid digest in the 'integrity' attribute for resource 'http://example.com/pwaexperiment/wwwroot/_framework/wasm/dotnet.3.2.0.js' with computed SHA-256 integrity '80L/hSwps3gjABzV78X6mehoDDgsLkm1pKpSS6fAqiE='. The resource has been blocked.
What does this error mean and how can I fix it?
Try adding the following tag to your project:
<BlazorCacheBootResources>false</BlazorCacheBootResources>
Reference: https://github.com/dotnet/aspnetcore/issues/24505#issuecomment-684857753
Your server may be compressing JS files on the fly, that changes content so integrity fails. Disable compression.
Try to delete the bin and obj folders in the project. Then the compiler will rebuild the blazor.boot.json file with the new hashes. And it loads and passes the hash check on the browser.

Xbox-live Sign-in issues with IL2CPP scripting backend

I signed up for the Creators program and am now testing the Xbox Live plugin for Unity.
For testing I only want to sign in a user.
Using .Net as scripting backend everything works just fine and I can see a fake user signed in in unity and I can also use the sandbox on Windows and on the Xbox.
Once I switch to the scripting backend IL2CPP I can still see the fake user if I run the scene in Unity. However, if I build I get a FileNotFound exception for the .csproj that was obviously not generated as Unity generates a .vcxproj file instead (using IL2CPP backend). The build however is still creating a VS Project. I can manually rename the file in the XBoxLivePostProcessing.cs which removes the exception but does not make the build work.
Opening the build in Visual Studio the XBoxServices.config file has not been added to the project. If I run the build everything looks normal but no user is being signed in (it shows "Gamertag" and "Gamerscore"). Adding the XBoxServices.config and setting "Content" to "True" will cause the build to crash once executed at a line that says NOT_IMPLEMENTED_ICALL. Also there is an error which complains that the XBoxServices.config file has no valid XML structure, which is weird as the file is set to be a text file and does not contain any XML, am I missing something here? Can I somehow tell VS to not interpret the file as XML file?
More importantly is there a way to fix the build issue in Unity? Does anyone have an idea what might be wrong and how to fix it?
So it seems like I simply had an old version of the Xbox Live plugin. The full IL2CPP support was added in version 1801.

Scanning with Morena generates error: Failed to load twain_32.dll

I am working on a scan applet for browser. I use Morena 6.4.
Everything works on my local PC.
Sometimes this applet is started behind Citrix application server (4.5 version). Everything for image scanning is configured ok - some native applications can scan (this application uses TWAIN, like Morena).
When I try to scan with Morena, I get this error:
SK.gnome.twain.TwainExcaption: Failed to load twain_32.dll (error=126)
Image of the error:
According to your description, it seems be a permission issue, i.e. morena doesn't have enough permission to load twain_32.dll. What I used to verify it is to run the application as administrator, i.e. right click on the app, choose "run as admin".
In addition, please double check if the DLL (twain_32.dll) exists in C:\Windows. If not, you can download or copy one to this folder.
Hope my answer helps.

failed to load RSL textLayout

I just installed gentoo linux amd64.
on that I installed eclipse 4.2M5 with FD5 for flex development.
after compiling my project, when I execute it i get the following in the log file:
Error #2046: The loaded file did not have a valid signature.
Failed to load RSL http://fpdownload.adobe.com/pub/swz/tlf/1.1.0.604/textLayout_1.1.0.604.swz
Failing over to RSL textLayout_1.1.0.604.swz
Error #2046: The loaded file did not have a valid signature.
i use FD5 with Flex 4.1A.
any ideas why it happens ?
update:
it seems that when I close and open my project I am able to execute my project once. the 2nd time that I execute the project on my browser I get the error and I need to close and reopen the browser to execute it again.
First of all thank you for all of your comments.
I finally was able to properly resolve the issue.
it seems that flash saves cache info at ~/.macromedia
(~ for home dir, for example if the user is ufk so it translates to /homeukf)
all I need to do is to delete that folder, since then I am able to refresh my app on the browser without any problems.