"A JavaScript error occurred in the main process" after installing Unity Hub

I received this error after installing Unity Hub for the first time. Have tried reinstalling, rebooting, running as administrator, looking at the permissions, searching the Internet for answers and I’ve been able to find nothing. Anyone else have this issue?

@davidpierre I have the same issue. Until few days ago, unity hub was working fine but when I tried to open it today, I get this same error.

Happened to me as well.
I found out it was caused by UnityHub not being able to access Temp folder. Specifically my user temp folder, by default located at C:\Users\YOUR-USER-NAME\AppData\Local\Temp

In my case Windows environment variable TEMP and TMP got messed up by some program installation.
Setting them back to original default values fixed the UnityHub crash. (And potentially prevented many more programs crashing)

I am having the same exact issue with Hub 3.4.2. I have already checked the environment variables that point to the Temp folder and they are properly set.
If I open the hub with administrator privileges the error won’t pop-up but then im getting warnings when i open any project because the Unity is running with administrator privileges too.
I have reinstalled the Hub too and the issue persists.

Same issue with Hub 3.5.0. It can open with admin access, but can’t sign in from inside the Hub, as sign-in opens browser and browser tries to re-open Hub (and can’t without admin).

Hey,
You must have not been an administrator, therefore, it showed access denied as you are trying to access the temp folder and you are probably a standard user with normal computer rights while the administrator has access to the whole platform and etc. If you want, you can change your account from standard to admin which would make your life easier or just reopen unity with admin (right-click and click run as administrator, not unity hub) You could also change the instances when the UAC prompt is required but the best option is that your account should be an administrator (it is not required but it’s your choice as then you would have to enter the admin account pin to do stuff that is above your access level :slight_smile: ).

I know this may be a little confusing as I am not the best explainer but tell me if any questions!

Thanks
Advik

Run chrome with administrator and login ,100% fix

One solution seems to be to check and change the security settings on the AppData\Local\Temp folder: go to Properties>Security and click Advanced. Then change the Owner at the top of the dialog to make sure it is your (admin) user profile by clicking Change then entering your user name with Check Names. Then check Replace owner on subcontainers and objects, and also check Replace all child object permission entries from this object, and apply. This will force full ownership to be wholly transferred to your profile.