Microsoft teams a javascript error occurred in the main process

Hello Everyone,

While installing Microsoft Teams, the error message described in the subject line is thrown.

Am running Microsoft Windows Version - 1909

A couple of troubleshooting tips found on https://docs.microsoft.com/en-us/MicrosoftTeams/troubleshoot-installation have been tried but the error still shows up.

Any idea on how to resolve this issue will be greatly appreciated.

UPDATES

I did a comparison of 2 SquirrelSetup.log files. (Both PC runs Windows 1909 and the same build number.

The PC 1(Throwing up the JavaScript error above)logged some issues not found in the PC 2 as shown below:

----start----

ApplyReleasesImpl: Couldn't run Squirrel hook, continuing: C:\Users\Administrator\AppData\Local\Microsoft\Teams\current\Teams.exe:
System.OperationCanceledException: The operation was canceled.
at System.Threading.CancellationToken.ThrowOperationCanceledException()
at Squirrel.Utility.<>c__DisplayClass11_0.<InvokeProcessAsync>b__0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotificat ion(Task task)
at Squirrel.Utility.<InvokeProcessAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotificat ion(Task task)
at
Squirrel.UpdateManager.ApplyReleasesImpl.<>c__DisplayClass18_1.<<invokePostInsta ll>b__2>d.MoveNext()

---end----

FURTHER UPDATES

Many suggestions found on GitHub, Microsoft support site, blogs and other websites have been tried. So after spending several hours googling and searching for a working solution, the following finally worked on the PC in question.

  • A standard user account was created on the PC.
  • Downloaded a new Microsoft teams app.
  • In services.msc, the status of a service called Quality Windows Audio Video Experience was also manually started.
  • Executed the app and no JavaScript error was thrown.

N.B: I am still not satisfied with this fix, cos i applied the same troubleshooting approach on another PC throwing up the same JavaScript error, and the fix doesn't work on it. :)

Although most people don’t know the first thing about JavaScript, it’s responsible for powering most of what you see on the internet. Thus, JavaScript errors have the potential to be a big deal. Fortunately, we have a quick fix available to us in this case.

Solution A:

  • Use Win/Start+R
  • Enter appwiz.cpl
  • Hit “OK”
  • Uninstall “Visual C++” files
  • Reinstall Microsoft Visual C++ Redistributables

Solution B:

  • Hit the Start/Win key
  • Search “add or remove programs”
  • Hit the Enter key
  • Find and select Microsoft Teams
  • Click Uninstall
  • Reinstall Microsoft Teams

At this time: two methods exist to resolve your issue. The first method involves the reinstallation of your redistributable visual c++ files. Alternatively, you can replace your Microsoft Teams installation with a new one. A step-by-step guide has been provided for both methods.

For your convenience: take advantage of the following links— you can access content faster.

  1. Reinstalling Microsoft Visual C++ Redistributables
  2. Reinstalling Microsoft Teams
  3. Blog post recap
Microsoft teams a javascript error occurred in the main process

Reinstalling Microsoft Visual C++ Redistributables

The following method aims to correct the isolated source of the problem. Think of replacing a faulty component within a device for a better analogy.

Step 1 — Open the Windows “Run” prompt

The “Run” prompt is accessed via the shortcut Win/Start+R. You can alternatively access the “Run” prompt by hitting “Start” and searching for “Run.”

Microsoft teams a javascript error occurred in the main process

Step 2 — Run appwiz.cpl

In the “Run” prompt’s text field: enter appwiz.cpl and hit “OK.”

Microsoft teams a javascript error occurred in the main process

Step 3 — Uninstall Microsoft Visual C++ Redistributables

Select files containing “Microsoft Visual C++ Redistributables.” After, click “Uninstall” via the action bar (above the list).

Microsoft teams a javascript error occurred in the main process

Step 4 — Reinstall the latest Microsoft Visual C++ Redistributables

If you’ve uninstalled each redistributable, you can proceed to reinstall the latest ones from Microsoft’s support page. Please avoid downloads from unofficial sources. When using an unofficial source, you risk exposing your system to harmful malware. For instance: trojans or ransomware.

Microsoft teams a javascript error occurred in the main process
Microsoft teams a javascript error occurred in the main process
Microsoft teams a javascript error occurred in the main process

Microsoft teams a javascript error occurred in the main process

Reinstalling Microsoft Teams

Unlike the last method, the following method aims to avoid escaping the problem completely. If we’re to re-use the last analogy, this would be replacing the device with a fault as a whole.

Step 1 — Open the Windows/Start menu

To begin, open the start menu. You can do this in two ways: pressing the Win/Start key or hitting the Windows icon at the start of your taskbar.

Microsoft teams a javascript error occurred in the main process

Step 2 — Search “add or remove programs”

In the start menu, click the search field and enter “add or remove programs.” Select the application as shown below.

Microsoft teams a javascript error occurred in the main process

Step 3 — Uninstall Microsoft Teams

Find Microsoft Teams within the application list— click the app followed by “Uninstall” afterward.

Microsoft teams a javascript error occurred in the main process

Step 4 — Reinstall Microsoft Teams

Head over to Teams’ download page. Once you’re there, you’ll immediately notice the “Download for desktop” button. Clicking the button will initiate the download for Microsoft Teams’ installer. Once the download is completed, open it up.

Microsoft teams a javascript error occurred in the main process

Blog post recap

Microsoft Teams’ main process may experience a JavaScript error from time to time. This issue can be resolved by reinstalling Microsoft Teams or its problematic dependencies. The dependencies in question are Microsoft Visual C++ Redistributables. Either method should suffice; however, you should still attempt both methods if one fails.

If you liked this post, you might enjoy one of our related posts. No hard feelings if you don’t check them out.

  • Can my company see my Teams messages? — If you’re prone to chat a lot, you’ve likely said things you wouldn’t want repeated. Thus, you ponder the idea that your Teams messages are being read. Unfortunately, that’s not an infeasible reality.
  • 2 easy ways to bulk invite your team to a Microsoft Teams meeting — Meetings play a large part in business and project management. If you’re stuck individually inviting several or more members, you should consider these methods to speed up the process.
  • What is the Microsoft Teams shortcut to mute the mic? [Windows and Mac walkthroughs] — If you’re not a fan of a push-to-talk setup but don’t want to be heard all the time, the mute shortcut will be of great use to you. If you’re unfamiliar with the shortcut, have a read to find out more.
  • How to paste without formatting in Microsoft Teams — Microsoft Teams supports markdown text; it’s a blessing and a curse. If you’re trying to paste some plaintext and keep getting formatting-carry-over, try this method to fix it.

Recent Posts

link to How to connect organizations in Microsoft Teams

How to connect organizations in Microsoft Teams

If you work with multiple organizations, it may be inconvenient for you to switch between accounts. However, Microsoft Teams lets you connect your organizations easily by giving access to guests....

link to How to get rid of background noise in Microsoft Teams

How do I fix JavaScript errors in Microsoft Teams?

How to fix the Microsoft Teams error “A Javascript error occurred in the main process”.
Use Win/Start+R..
Enter appwiz. cpl..
Hit “OK”.
Uninstall “Visual C++” files..
Reinstall Microsoft Visual C++ Redistributables..

How do you fix the A JavaScript error occurred in the main process?

Re: Windows - A JavaScript error occurred in the main process.
Open Control Panel > Uninstall a program..
Locate latest Microsoft Visual C++ (64bit) and click on Change (If you're using 64 bit version of Teams, maybe you need x86).
Click on Repair..
Enter your Admin credentials to perform repair..

How do I get rid of script errors on my team?

Disable Script Error Notifications.
Type Internet Options in the Windows Search bar and double-click on the first result..
Then navigate to the Advanced tab and go to Browsing..
Uncheck the following options: Display a notification about every script error. ... .
Apply the changes and launch Teams again..

Does Microsoft Teams use JavaScript?

This JavaScript library is part of the Microsoft Teams developer platform. See full SDK reference documentation.