FacebookTwitterLinkedIn

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

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

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

a javascript error occurred in the main process

Discord's JavaScript error message has two known variations that include:

A JavaScript error occurred in the main process

A fatal Javascript error occured

What Causes the JavaScript Error in Discord and How to Fix It?

  • Corrupted Discord files and/or settings. If Discord's installation has been corrupted, reinstalling it should fix the problem.
  • 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.
  • Quality Windows Audio Video Experience service (qWAVE). This service provides features for streaming multimedia and real-time content over variable bandwidth networks. If this service is not running, Discord will throw a JavaScript error. The solution is to set qWAVE to start automatically.
  • Running Discord with administrative privileges. If Discord runs with administrative privileges, this setting may cause the error. To fix it, you can try disabling the "Run as administrator" option for Discord.
  • Previous Discord installation. Installing it again can sometimes trigger a 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. 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.

About PCrisk

PCrisk is a cyber security portal, informing Internet users about the latest digital threats. Our content is provided by security experts and professional malware researchers. Read more about us.

Malware activity

Global malware activity level today:

Medium threat activity

Increased attack rate of infections detected within the last 24 hours.