How to Fix the ‘A JavaScript Error Occurred in the Main Process’ Error in Discord?

The “A JavaScript error occurred in the main process” error usually appears when starting up Discord on your computer. The error message window usually contains various information regarding the error but it can hardly be interpreted by casual users.

A JavaScript Error Occurred in the Main Process

There have been many different methods people used in order to resolve this problem. The methods are usually simple enough to perform easily without wasting too much time. Make sure you follow the instructions carefully and the problem should disappear in no time.

What Causes the ‘A JavaScript Error Occurred in the Main Process’ Problem in Discord?

There aren’t many determined causes for this problem and most troubleshooting methods you can perform are based on resetting Discord or its settings in one way or another. Still, we have prepared a short list for you to check out:

  • Discord or its settings may have gone corrupt – In this scenario, it’s the Discord installation to blame so either reset its settings or reinstall the app.
  • The Quality Windows Audio Video Experience service is not running – This service is vital to the app since it’s tightly related to the program’s core functionality. Make sure it starts up automatically.
  • Discord runs with administrator permissions – Running Discord with administrator permissions is known to cause this problem so make sure you remove this option.

Solution 1: Delete Discord Folders in %AppData% and %LocalAppData%

Deleting the following folders should reset Discord settings and hopefully resolve the JavaScript error which is preventing you from opening Discord at all. These steps were originally suggested by the Discord website for an entirely different issue but users have reported that it should resolve this problem as well.

  1. Navigate to the following location on your computer by opening the Windows Explorer and clicking on This PC:
  1. If you are unable to see the AppData folder, you may need to turn on the option that enables you to view hidden files and folders. Click on the “View” tab on File Explorer’s menu and click on the “Hidden items” checkbox in the Show/hide section. File Explorer will show the hidden files and will remember this option until you change it again.
Viewing the hidden AppData folder
  1. Delete the Discord folder in the AppData folder. If you receive a message saying that some files couldn’t have been deleted because they were in use, try exiting Spotify and ending its process in Task Manager.
  2. Either click the Start button or the search button next to it and type “Run” or use the Windows Key + R key combination in order to bring up the Run dialog box. Type in “%localappdata%” and click Enter.
Opening the LocalAppData folder
  1. Locate the Discord folder in the folder which opens, right-click on it, and choose the Delete
  2. Make sure that the folders are completely deleted and that there are no more remaining files in it. Check to see if the Discord error still appears after restarting your computer!

Solution 2: Change the Startup Type of the Quality Windows Audio Video Experience Service

Changing the startup type of the Quality Windows Audio Video Experience service from Manual to Automatic managed to resolve the JavaScript error for many users. They also reported that the method managed to resolve the JavaScript error for apps other than Discord as well! Follow the steps below in order to resolve the problem!

  1. Open the Run utility by using the Windows Key + R key combination on your keyboard (press these keys at the same time. Type “services.msc” in the newly opened box without the quotation marks and click OK in order to open the Services tool.
Running the Services tool
  1. Locate the Quality Windows Audio Video Experience service on the list, right-click on it and select Properties from the context menu which appears.
  2. 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.
Setting the Quality Windows Audio Video Experience service’s startup type to Automatic
  1. Make sure that the option under the Startup type menu in the service’s properties window is set to Automatic before you proceed with other steps. Confirm any dialogue boxes which may appear when changing the startup type.

You may receive the following error message when you click on Start:

"Windows could not start the service on Local Computer. Error 1079: The account specified for this service differs from the account specified for other services running in the same process."

If this happens, follow the instructions below to fix it.

  1. Follow steps 1-3 from the instructions above in order to open the service’s properties window. Navigate to the Log On tab and click on the Browse… button.

  1. Under the “Enter the object name to select” entry box, type in your account’s name, click on Check Names and wait for the name to become available.
  2. Click OK when you are finished and type in the password in the Password box when you are prompted with it if you have set up a password. It should now start without issues!

Solution 3: Run Discord without Administrator Privileges

Some users have noticed that the app actually works whenever they are not logged in using their administrator account. This leads us to believe that the actual problem regarding the tool is the administrator permissions.

It’s not always the best idea to run random programs as an administrator and various users have reported that running Discord without admin permissions actually resolved the problem for them!

  1. Locate the Discord executable and change its properties by right-clicking its entry either on the Desktop, the Start menu, or the Search results window and choose Properties. Navigate to the Compatibility tab in the Properties window and uncheck the box next to the Run this program as an administrator option before applying the changes.
Unchecking the Run this program as an administrator checkbox
  1. Make sure you confirm any dialogs which may appear for you to confirm your changes and Discord should launch without admin privileges from now on. Open it by double-clicking its icon and try to see if the error still appears.

Solution 4: Reinstall Discord

Performing a reinstall is one of the most important methods in this article as this solution has worked for plenty of people who struggled with this problem. This solution is generic but it’s vital to follow every step correctly if you want to reset your Discord installation and make it work properly again.

  1. First of all, make sure you are logged in with an administrator account as you won’t be able to delete programs using any other account.
  2. Click on the Start menu and open Control Panel by searching for it. Alternatively, you can click on the cog icon in order to open Settings if you are using Windows 10.
  3. In Control Panel, select to View as: Category at the top right corner and click on Uninstall a Program under the Programs section.
Uninstall a program in Control Panel
  1. If you are using the Settings app, clicking on Apps should immediately open a list of all installed programs on your PC.
  2. Locate Discord in Control Panel or Settings and click on Uninstall.
  3. Discord’s uninstall wizard should open, prompting you up with a choice to “completely remove Discord on your computer”. Choose Yes.
  4. Click Finish when the uninstalling process finishes.

If you managed to uninstall the tool properly, it’s time to simply reinstall the Discord tool by downloading the latest installer from their website, running it from the Downloads folder, and following the instructions on-screen until the process finishes. The Javascript error should not appear anymore.

Downloading Discord

Solution 5: Closing all Discord Processes

We will try ending all processes from the task manager and try installing Discord again. Discord is known to fail its installation if has parallel processes running beforehand. The only way to counter this is to stop all Discord processes from Task Manager.

  1. Press Windows + R, type “taskmgr” in the dialogue box, and press Enter.
    Running the Task Manager
  2. Once in the task manager, search for all Discord processes, click on it, and select End Process.
  3. Now try installing and see if it fixed the problem.

If you can’t able to end some of the Discord Instances you can try this workaround with Command Prompt to get rid of them. Follow these steps:-

  1. Click on the Windows Search bar and type “Command Prompt”, right-click on it, and run as administrator.
  2. Type the following command and press enter:-
    taskkill /f /im discord.exe
  3. Now check to see if the issue still persists.

Solution 6: Using Discord PTB

Discord PTB is discord’s test beta build, you can download it from the official discord website. It will install and function just like Discord should however it have its own data and it will not interact with your normal discord. You can download Discord PTB (here).

Kevin Arrows
Kevin is a dynamic and self-motivated information technology professional, with a Thorough knowledge of all facets pertaining to network infrastructure design, implementation and administration. Superior record of delivering simultaneous large-scale mission critical projects on time and under budget.

Expert Tip

How to Fix the ‘A JavaScript Error Occurred in the Main Process’ Error in Discord?

If the issue is with your Computer or a Laptop you should try using Restoro which can scan the repositories and replace corrupt and missing files. This works in most cases, where the issue is originated due to a system corruption. You can download Restoro by clicking the Download button below.

Download Now

I'm not interested