FacebookTwitterLinkedIn

Fix Discord JavaScript Error

How to Fix "A JavaScript error occurred in the main process" Error in Discord

Many Discord users have complained about getting a JavaScript error in Discord, saying, "A JavaScript error occurred in the main process." Luckily, fixing Discord's JavaScript error is relatively easy using the methods provided in this article.

JavaScript Error Discord

What Causes the JavaScript Error in Discord?

The most common cause for "A JavaScript error occurred in the main process" is corrupted Discord's files and/or settings. Therefore, all fingers point to Discord's installation, so reinstalling this program should fix the problem.

A lesser-known cause for the JavaScript error in Discord is third-party antivirus programs. These programs may mistakenly isolate and quarantine some of Discord's files, resulting in a corrupted installation. Therefore, we recommend checking your antivirus program's quarantine vault to see if there are any Discord files.

Another cause for Discord's JavaScript error is the Quality Windows Audio Video Experience service (qWAVE). This service provides features focused on streaming multimedia and real-time content over variable bandwidth networks. If this service is not running, Discord will throw the JavaScript error. The solution is to set qWAVE to start automatically.

Another reason for the JavaScript error in Discord is a rather odd one. If Discord runs with administrative privileges, this setting may be the cause of the error. To fix this error, you can try disabling the "Run as administrator" option for Discord.

"A JavaScript error occurred in the main process" may also occur when Discord was previously installed and uninstalled. Installing it again can sometimes trigger the JavaScript error. In such an event, we recommend Deleting all Discord-related temporary files found in %AppData%/Discord and %LocalAppData%/Discord.

Video guide on How to Fix "A JavaScript Error Occurred in the Main Process" Discord Error

Table of Contents:

Method 1. Run Discord Without Administrative Privileges

Many users have attested to the fact that running Discord without administrative privileges actually fixes the JavaScript error. So if you, for some reason, have configured Discord to run as administrator, we recommend that you uncheck this option and see if this fixes the error.

Right-click Discord shortcut and click Properties

1. Right-click Discord’s shortcut and click Properties.

Uncheck Run this program as administrator

2. Navigate to the Compatibility tab.

3. Unmark the checkbox next to the Run this program as an administrator option.

4. Click Apply and click OK.

5. Launch Discord to see if the issue was fixed.

[Back to Table of Contents]

Method 2. Configure Quality Windows Audio Video Experience Service (qWAVE) to Start Automatically

Quality Windows Audio Video Experience service (qWAVE) is essential for Discord to work properly. The startup type of this service is set to manual by default. Changing the startup type to automatic may resolve the issue.

1. Hold down Windows+R keys to open Run.

Type in services.msc and click OK

2. Type in services.msc in the Run dialog box and click OK.

Right-click qWave and click Properties

3. Scroll through the services list and find Quality Windows Audio Video Experience.

4. Right-click the service and click Properties.

Set Startup type to Automatic

5. Open the Startup type drop-down menu and select Automatic.

Start qWave service and click Apply and click OK

6. Under Service status, click Start.

7. Click Apply and click OK.

8. Launch Discord to see if the issue was fixed.

[Back to Table of Contents]

Method 3. Reinstall Discord

If none of the methods work and you keep getting the JavaScript error, you can try reinstalling Discord as a last resort solution. Reinstalling Discord will remove any corrupt files replacing them with new ones.

1. Make sure no Discord processes are running. Hold down Ctrl+Shift+Esc to open Task Manager.

Right-click Discord process and click End task

2. Find all Discord-related processes, right-click them and click End task.

Right-click Start and click Apps and Features

3. Right-click the Start Menu button and select Apps and Features.

4. Scroll through the list and find Discord.

Select Discord and click Uninstall

5. Select Discord, click Uninstall, and then click Uninstall again.

6. Wait for Discord to uninstall.

Go to Discord's download page

7. Then, open your browser and go to Discord’s download page.

Click the Download for Windows button

8. Click the Download for Windows button.

9. Run the installer once the download is complete. Discord will launch automatically once the installation is complete.

[Back to Table of Contents]

Method 4. Delete Discord Folders in %AppData% and %LocalAppData%

Discord stores temporary data on your PC in hidden %AppData% and %LocalAppData% folders. Deleting Discord folders in the previously mentioned locations serves to reset Discord’s settings and should resolve the JavaScript error when attempting to reinstall Discord. However, you have to make sure that no Discord processes are running because if they are, then not all files will be deleted.

We also recommend terminating all of Discord’s processes and trying to run it again first. If that doesn’t work, then proceed with deleting Discord folders in %AppData% and %LocalAppData%.

1. Make sure no Discord processes are running. Hold down Ctrl+Shift+Esc to open Task Manager.

Right-click Discord's processes and click End task

2. Find all Discord-related processes, right-click them and click End task.

Right-click Start and click Apps and Features

3. Right-click the Start Menu button and select Apps and Features.

4. Scroll through the list and find Discord.

Select Discord and click Uninstall

5. Select Discord, click Uninstall, and then click Uninstall again. Wait for Discord to uninstall.

6. Hold down Windows+R keys to open Run.

Type in %AppData% in Run and click OK

7. In the Run dialog box, type in %AppData% and click OK.

Right-click Discord's folder and click Delete

8. Find the Discord folder, right-click it and click Delete.

9. Close the window.

10. Again, hold down Windows+R keys to open Run.

Type in %LocalAppData% in Run and click OK

11. Type in %LocalAppData% and click OK.

Right-click Discord folder and click Delete

12. Find the Discord folder, right-click it and click Delete.

Go to Discord's doownload page

13. Then, open your browser and go to Discord’s download page.

Click Download for Windows to get Discord

14. Click the Download for Windows button.

15. Run the installer once the download is complete. Discord will launch automatically once the installation is complete.

[Back to Top]

▼ Show Discussion

About the author:

Rimvydas Iliavicius

Rimvydas is a researcher with over four years of experience in the cybersecurity industry. He attended Kaunas University of Technology and graduated with a Master's degree in Translation and Localization of Technical texts in 2017. His interests in computers and technology led him to become a versatile author in the IT industry. At PCrisk, he's responsible for writing in-depth how-to articles for Microsoft Windows. Contact Rimvydas Iliavicius.

Our guides are free. However, if you want to support us you can send us a donation.