I was trying to install discord on my pc and a weird error occurred like – “A fatal javascript error occurred. Error: Cannot find module ‘discord_desktop_core’“. I tried multiple things, as suggested on multiple websites, but nothing worked.
Generally, these errors occur either due to corrupt installation or wrongly file flagged by antivirus. Here is a tweet where Avast confirms that sometimes files are wrongly flagged and Discord is a victim of that.
Thanks, Avast. u.u
— Discord (@discord) June 14, 2018
But there are some malwares and potentially dangerous apps in the market with the name of Discord. So you have to be careful about it. Always download the software from genuine websites only. Bitdefender found a fake Discord Npm package. Similarly, Malwarebytes also blocked discord’s cdn because they found some dangerous file in it. But the issue was resolved later.
The errors could be in many forms like –
A JavaScript error occurred in the main process: Uncaught Exception: Error: Object has been destroyed at MenuItem.click
A fatal javascript error occurred. Error: Cannot find module ‘./core’
There are many more error types but they all could be solved by following the provided steps in this article.
Solution – Reinstall Discord but with proper steps
With the change in OS updates, drivers, antivirus policies etc., sometimes already installed software breaks. This happens a lot with JavaScript based software because this language is a scripting language and it’s primary use is in web based software. But since Discord is developed using javascript, so we are facing these error and issues.
I hope you have tried multiple things and still the problem is not solved. But in this article you will get the exact solution for this discord problem. Some of my students told me about these problems and I guess you faced them too –
“The action can’t be completed because the folder or a file is open in another program” while trying to delete discord folder from appdata or appdata/local.
Okay, let’s talk less and solve your discord issues without complicating things.
First of all, try to open this article in your mobile device because you will need to restart your computer in safemode.
Step 1 – Restart computer in safemode
We need to uninstall the current discord software. The best way is to enter into safemode of windows operating system. I will show the instructions for windows 10.
- Open your windows login screen.
- Press and hold shift key.
- Select Power > Restart (while keep holding shift key).
- Your PC will restart now and you will get “Choose an Option” screen. Select Troubleshoot from that.
- Select Advanced Options.
- Now select Startup Settings and press Restart. (Note: Startup settings option could be at any position. Doesn’t mean it will be the last option. Sometimes I find it in 2nd place too.)
- You PC will restart and you will see the list where you can find Safe Mode options. Select Enable Safe Mode with Networking.
Now you PC is in Safe Mode. It means you can easily uninstall Discord without having errors. Safe mode will look like this –
You can see there is Safe Mode written at all 4 corners of the screen. This indicates that you are in safemode.
Step 2: Uninstall Discord from Add or Remove Program Setting
Remove discord from your PC using Add or Remove program setting.
- From windows search bar, find “Add or Remove Program”.
- Locate Discord from the installed applications list.
- Click on Uninstall and remove it.
Step 3: Remove Discord directory from Local and Roaming folder of AppDir
Now we have to remove all the traces of discord from our pc. There are files in local and roaming folder which we need to delete.
- Open run utility by pressing windows key ( ) + R. Or searching run in start.
- Enter %appdata% and press OK
- Delete Discord folder
- Again open run utility and enter %tempappdata% and press OK
- Delete Discord folder from here too
- Restart PC
Your PC will restart in normal mode now.
Step 4: Reinstall Discord
Now you can install the latest version of Discord from official website.
Hope this solves your discord javascript error issue. If you are still getting the error then check if your antivirus is blocking the discord files. Whitelist it’s directory. The steps to do that is completely dependent on the antivirus you are using.
As a personal suggestion, you should always use MalwareBytes because I found it best in the market. It helps in removing virus, trojans, adwares, malwares, ransomwares and all the potentially dangerous applications. It also has free browser extension which will protect you from all dangerous websites. Also, it is very cheap and affordable.
You may also like –