Discord is a popular VoIP and messaging service intended for gamers. It has many features such as private servers, live streaming and a lot of other useful utilities for gamers.

But as with any application, bugs & errors can spoil the experience. Discord has one such error which can affect the installation process or even a functional Discord installation on your system — the ‘Fatal JavaScript Error’.

This fatal JavaScript error may be caused by some corrupt file. These files need to be deleted before we can reinstall Discord to solve the issue. The Discord may be running as a background process and won’t allow us to delete these files, so we need to exit the application.

Go to the system tray in the Windows taskbar, then right-click on Discord icon and select ‘Quit Discord’.

But sometimes even after exiting Discord, the background process may still be running in some rare cases.

So press Ctrl+Alt+Del and click on Task Manager to open it, then go to the Details tab. Look for the Discord.exe process in the list, if it doesn’t exist in Details tab that means the Discord was successfully closed by the first method we used. If you find Discord.exe, right-click on any of the Discord processes and click on ‘End process tree’ option.

After exiting Discord and making sure that no stray background process is running, we need to delete two different Discord folders in your Windows users’ app data files to get rid of the fatal JavaScript error.

For the first folder, press Win+R keys to open the Run command box and type %appdata% and hit enter.

This will open the C:\Users\<username>\AppData\Roaming directory in the Windows Explorer. Look for the discord folder, right-click on it, and select ‘Delete’. This will delete the temporary files used by Discord.

Similarly, for the second folder open the Windows Run, then type or paste %localappdata% and hit Enter.

This will open the C:\Users\<username>\AppData\Local location in the File Explorer on your PC.

Inside Local AppData directory, find the folder named ‘Discord’ and delete it.

If you encounter error telling you that these folders can’t be deleted because they are still in use, then it means the Discord has not been closed correctly. Make sure you completely closed Discord app following the instructions above and then try again.

Once you’ve cleared the Discord AddData folders, it’s time to reinstall Discord.

Head on over to the Discord Downloads page to get the installer file if you don’t already have it. Then, double-click on it and initiate the installation process.

This time you won’t get any pesky errors like before. But in case you do get the same error, make sure to disable your antivirus for the duration of the Discord installation.

Alternatively, if have winget installed on your PC, you can run the following command to install Discord effortlessly from the command line.

winget install Discord.Discord

Learn more winget and how easy it is to install apps using winget on a Windows PC.