Basically, the same issue as mentioned here:

https://answers.microsoft.com/en-us/msteams/forum/all/teams-javascript-error-windows-10-1709/bdecf01b-0b17-4ef0-aa94-be26e9f1276c

This has just happened to one of my customers who is redirecting %appdata% to a network share.

Teams loads fine when the profile is created but after signing out and back into Windows, the javascript error pops up and Teams will not load. Identical error to the one in the post above:

A JavaScript error occurred in the main process

Uncaught Exception:

Error: EEXIST: file already exists, mkdir

Using Windows 10 Enterprise 21H2 and latest version of Teams machine wide installer. UE-V doesn't solve the issue as the point of redirecting appdata/roaming is to stop the hard drive from filling up as this is an environment with shared PCs where each machine can easily see 100 users sign in per month and Teams likes to dump approx 2GB of data into that folder.

Hi @Derek McCoy ,

This has just happened to one of my customers who is redirecting %appdata% to a network share.

As far as I know, the redirection of the %appdata% folder can indeed lead to issues in some applications. And the JavaScript error you encountered is probably not a Teams-specific error message.

Given this situation, instead of redirecting the %appdata% folder, how about considering clearing the Teams cache files periodically for all users to avoid the filling up of the hard drive?
For instance, you can use the command below and try running it automatically at specified time using the Task Scheduler:

remove-Item "C:\Users\*\AppData\Roaming\Microsoft\Teams\*"