A javascript error occurred in the main process forticlient vpn

Hello,

Our internal Engineering team still investigating on this. 
As for my personal experience, I got the exact error and managed to fix it by below:

1. Uninstall current FCT

2. Install the latest C++ redistribute https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170

3. Uninstall any old C++ redistribute found in Control Panel (eg: 2008, 2013)

4. Install your intended FCT version again

5. Error not appearing anymore

Hopefully this works for you as well.

Regards,
Bon

Hi everyone,

ANyone having this issue?

A javascript error occurred in the main process forticlient vpn

I try these things:
1-) reinstall Forticlient VPN from control panel
2-) Reinstall Forticlient VPN manually by deleting every single folder inside program failes, programdata, appdata
3-) Uninstall forticlient vpn using FCREMOVER.exe provided by fortinet.
4-) Uninstall java and install latest version
5- Reboot computer between each try

Nothing worked and still having the javascript error when I try to open forticlient after the installation.

I use this link to download it:
https://filestore.fortinet.com/forticlient/downloads/FortiClientVPNOnlineInstaller_6.4.exe
If anyone know where is the issue, let me know.

Thanks again and have a nice day to everyone

I have an error coming up that just started happening when I open our VPN client. The VPN Client is Forticlient version 7.  The laptop is a Windows 10 Pro 21H1 with 16GB of RAM. The error that I'm getting is "A Java script error occured in the main proocess"

Uncaught Exception:

TypeError: Messenger.Sender.TraceLog is not a function

at App.app.on (C:\Program Files\Fortinet\FortiClient\Resources\app.asar\assets\js\main.js:2027:24)

at App.emit (events.js:187:15)

I have removed Java and re-installed it with the latest version. I have removed the FortiClient VPN software and installed the latest version. 

I did get it to work once when I set the service "Quality Windows Audio Video Experience" to start and run automatically. I found an article that helped someone else with the same problem. But now it is back to the same old error. 

Sometimes when you try to open an application in windows it may pop an error “A javascript error occurred in the main process” most of the time it happens with chatting apps like Discord, Skype, or Microsoft Team but maybe it happens with VSCode or Forticlient VPN.

It doesn’t matter which application cause this error for you, matter how you can fix it with minimum effort. In this article, I share the exact way to fix this error.

All the articles on this topic have the almost same content but all of them still missing one thing that may the reason for you.

What causes the ‘A JavaScript Error Occurred in the Main Process’ error?

  • Your program or its settings may have gone corrupt
  • The Quality Windows Audio Video Experience service is not running
  • Your app runs with administrator permissions
  • You don’t have the right version of Microsoft Visual C++ Redistributable

How to fix the “A javascript error occurred in the main process” error?

  1. Ensure that you have the Microsoft Visual C++ Redistributable

Very Important Note: If you are not sure about it don’t worry just leave it for now, follow the rest steps but after that, if you still have the same error then download Microsoft Visual C++ Redistributable.

  1. Open Run program by searching it.

A javascript error occurred in the main process forticlient vpn

  1. Type “%appdata%” in the Run window

A javascript error occurred in the main process forticlient vpn
Type %appdata% in the Run window

  1. Press Enter, it will open a folder
  2. Search for the application folder (In our case it’s the folder name is “Discord” because in our case Discord cause this error).
  3. Delete it by right-clicking on it and then choose the delete option.
A javascript error occurred in the main process forticlient vpn
Delete it by right-clicking on it and then choose the delete option.
  1. Close that window
  2. Open Run program again.
A javascript error occurred in the main process forticlient vpn
  1. Type “%localappdata%” in the Run window

A javascript error occurred in the main process forticlient vpn
Type %localappdata% in the Run window

  1. Press Enter, it will open a folder.
  2. Search for the application folder (In our case it’s the folder name is “Discord” because in our case Discord cause this error).
  3. Delete it by right-clicking on it and then choose the delete option.
A javascript error occurred in the main process forticlient vpn
Delete it by right-clicking on it and then choose the delete option
  1. Close that window
  2. Now, Open Services by searching it
A javascript error occurred in the main process forticlient vpn
Open Services by searching it
  1. Scroll and find a service called “Quality Windows Audio Video Experience”

A javascript error occurred in the main process forticlient vpn
Scroll and find a service called Quality Windows Audio Video Experience

  1. Right-click on it and select Properties
A javascript error occurred in the main process forticlient vpn
Right-click on it and select Properties
  1. Select Automatic option under Startup type
A javascript error occurred in the main process forticlient vpn
Select Automatic option under Startup type
  1. If the service is started (you can check that just next to the Service status message), you should stop it by clicking the Stop button in the middle of the window. Anyway, run it again by clicking the Start
A javascript error occurred in the main process forticlient vpn
Stop it by clicking the Stop button. Run it again by clicking the Start
  1. (Optional) If you see an error when clicking on Start follow this step. Navigate to the Log On tab and click on the Browse buttonUnder the “Enter the object name to select” entry box, type in your account’s name, click on Check Names Click OK when you are finished, and type in the password in the Password box
  2. Now, Uninstall the application and install it again (if the error is not resolved)

The below steps are only for Discord

  1. After reinstalling the Discord, search for Discord

A javascript error occurred in the main process forticlient vpn
Search for Discord

  1. Then right-click on it
  2. Click on “Open file location” from the menu
A javascript error occurred in the main process forticlient vpn
Then right-click on it
  1. It will open a folder with Discord selected.
  2. Right-click on the Discord.exe (automatically selected file).

A javascript error occurred in the main process forticlient vpn
Right-click on the Discord.exe

  1. Click on Properties

A javascript error occurred in the main process forticlient vpn
Click on Properties

  1. Go to the Compatibility tab

A javascript error occurred in the main process forticlient vpn
Go to the Compatibility tab

  1. Uncheck the “Run this program as an administrator” option

A javascript error occurred in the main process forticlient vpn
Uncheck the Run this program as an administrator option

  1. Click on OK

If you still have the error go to step 1 you may forget about it.

Let me know if this article does not help you to solve the problem.

How do you fix 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..

What does a JavaScript error occurred in the main process mean?

Before getting into the main subject of this guide, it is important for you to discover the most common reasons why this JavaScript error can occur in the main Discord process: Your program or its settings may have gone corrupt. The Quality Windows Audio Video Experience service is deactivated.

How do I fix FortiClient VPN error?

This article provides the solution when the error 'unable to establish the VPN connection. The VPN server may be unreachable (-20199)' is obtained in FortiClient trying to connect to the SSL-VPN. 1) Run the Wan miniport repair tool (or version 2). 2) Restart the computer and test VPN access again.

Why FortiClient VPN is not connecting?

This error happens when there is either: an incorrect configuration setting in the FortiClient desktop app. a network device (home router or ISP) blocking the configuration.