Fix Discord 'A JavaScript Error Occurred in the Main Process' on Windows
Source-checked · About 10 minutes
Answer
Close every Discord process, remove Discord's AppData and LocalAppData folders as its official error guide directs, restart Windows, and reinstall the current desktop app from Discord.
Capture the full JavaScript error and confirm it appears when opening the official Discord desktop app, not a bot, browser extension, or unrelated Electron program.
2
Close Discord completely
Exit Discord from the system tray, open Task Manager, and end remaining Discord processes so its files are no longer in use.
3
Remove Discord application data
Press Windows+R, open %AppData%, and delete the Discord folder; repeat with %LocalAppData%. This signs the desktop client out but does not delete server messages.
Restart the computer to release updater and application files, then sign back in normally.
5
Check available storage
Confirm the Windows system drive has room for Discord's download, extraction, and update files. Remove only files and apps you recognize, then empty no shared or system folder merely because its name looks temporary.
6
Keep one browser fallback
Before deleting application data, confirm Discord Web opens in a current browser and that you can complete account authentication. This preserves access if the desktop installation takes longer to repair.
7
Install the official client
Download Discord from discord.com/download, run the installer, and let the first update complete before restoring optional startup behavior.
8
Verify and escalate
Open Discord, sign in, and repeat the original launch. If the error returns, send Discord Support the screenshot, Windows version, and clean-install result.
Video walkthrough
If it does not work
If Windows says a folder is in use, return to Task Manager and close Discord and Update processes before retrying.
Do not download replacement DLL or JavaScript files from third-party repair sites.
ⓘ Sources and verification
Checked against official documentation on . Scope: Windows.
Follow the linked first-party guidance if labels differ after a platform or app update.