Windows 10 · Windows

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.

Guide steps8 steps
  1. Save the exact error
  2. Close Discord completely
  3. Remove Discord application data
  4. Restart Windows
  5. Check available storage
  6. Keep one browser fallback
  7. Install the official client
  8. Verify and escalate
  9. If it still does not work

Save the exact error

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.

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.

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 Windows

Restart the computer to release updater and application files, then sign back in normally.

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.

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.

Install the official client

Download Discord from discord.com/download, run the installer, and let the first update complete before restoring optional startup behavior.

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.

Continue with

Browse more Discord tutorials