JavaScript Error Occurred

Fix Discord 'JavaScript Error Occurred' in 5 Minutes

Discord's 'JavaScript Error Occurred' popup usually means a corrupted cache or an outdated client. Here's the fastest fixes, from clearing cache to full reinstall.

Cause #1: Corrupted Discord Cache

What's actually happening here is that Discord stores a bunch of temporary files — images, emoji, voice settings — in a local cache folder. When that cache gets corrupted (a crash, a power loss, or just a bad update), the app's JavaScript engine trips over it and throws the JavaScript Error Occurred popup instead of loading the UI. This is the most common cause by far, especially if you've had Discord open for days without restarting.

The fix is to nuke the cache. Don't worry, it doesn't touch your login, servers, or messages. Here's how on Windows:

  1. Press Ctrl+Shift+Esc to open Task Manager. Make sure Discord isn't running. If it is, right-click and choose End task.
  2. Press Win+R, type %appdata%\discord, and hit Enter. That opens AppData\Roaming\discord.
  3. Delete the Cache, Code Cache, and GPUCache folders. You can also delete the whole discord folder — Discord will recreate it on launch, but that also resets your login, so stick to the cache folders unless you're fine re-logging in.
  4. Restart Discord. It should load right up.

On macOS, the path is ~/Library/Application Support/discord — same folder names.

Why does this work? Discord is an Electron app, which bundles Chromium. The cache is aggressively used to speed up rendering. When a cached file is half-written or from an older version, the JS engine refuses to parse it and bails out. Clearing it forces a fresh fetch, and the error disappears.

Cause #2: Outdated Discord Client

Second on the list is an outdated client. Discord auto-updates in the background, but sometimes that update fails silently — maybe your antivirus blocked it, or the PC slept mid-download. You end up running a mix of old JS files and new ones, and the app throws the JavaScript error because the code just doesn't line up.

Check your version: open Discord, go to Settings (gear icon) → About. If you see a version older than a few weeks, that's suspicious. But honestly, even if it looks fine, force an update — it costs nothing.

To force an update on Windows:

  1. Close Discord completely (check the system tray).
  2. Press Ctrl+Shift+Esc and end any Discord.exe processes.
  3. Open the Discord install folder. The default is %LocalAppData%\Discord.
  4. Look for a subfolder like app-1.0.9163. If there's a newer folder sitting there, you can manually run the Update.exe inside the newest one.
  5. Simpler: just download the installer from discord.com/download and run it. It'll overwrite the old install and pull the latest version.

The reason step 4 works is that the Update.exe is a stub that checks the network and patches the app. Running it manually bypasses whatever broke the auto-update.

Cause #3: Corrupted App Data or Installation Files

If clearing the cache and updating don't help, the problem is deeper — the actual app files are corrupted. This can happen after a failed install, a disk error, or an antivirus quarantine that nuked a DLL. The symptom is usually the same popup, but sometimes you also see a white screen or the app freezes on the loading screen.

At this point, the real fix is a clean reinstall. Don't just uninstall from Control Panel — that leaves behind the AppData folders that might be the source of the problem.

Here's the full nuke-and-reinstall for Windows:

  1. Close Discord and end all Discord processes in Task Manager.
  2. Uninstall Discord via Settings → Apps (or Control Panel → Programs and Features).
  3. Press Win+R, type %appdata%, delete the discord folder.
  4. Press Win+R, type %localappdata%, delete the Discord and discord-updater folders.
  5. Restart your PC — this clears any file locks.
  6. Download the installer from discord.com and install fresh.

On macOS, you'd drag Discord from Applications to the Trash, then also delete ~/Library/Application Support/discord and ~/Library/Caches/com.hnc.Discord.

One thing I'll say: don't skip the restart. After uninstalling, Windows can hold file handles open, and the new install can fail to write cleanly. Restarting costs you a minute and saves you from a second reinstall.

When It's Not Discord's Fault

Sometimes the error is caused by your system, not Discord. If you're on Windows 10 or 11 and you've tried everything above, check your system clock. A wrong date/time breaks HTTPS certificate validation, and Discord's error popup can be a side effect. Right-click the clock → Adjust date/time → toggle Set time automatically.

Also, if you're running a proxy or VPN, disable it temporarily. Discord's updater and renderer don't always handle proxies gracefully, and a misconfigured proxy can trigger this exact error.

Quick Reference

CauseWhat to DoTime
Corrupted cacheDelete Cache, Code Cache, GPUCache folders in %appdata%\discord~2 min
Outdated clientRun Update.exe or reinstall from discord.com~5 min
Corrupted install filesUninstall, delete AppData folders, restart, reinstall~10 min

That's it. Start with the cache — it's the fastest and fixes most cases. If that doesn't work, move down the list. The key thing to remember is that this error is almost never a sign of a ban or account issue — it's just Discord's frontend failing to load. A clean house fixes it.

Related Errors in Software – Games & Drivers
Error 999 NVIDIA Driver Install Fails with 'Incompatible Version' Fix Fix Baldur's Gate 3 Keeps Crashing to Desktop on PC Error 1067 Fix Vanguard Error 1067: Verify TPM & Secure Boot DirectX encountered an unrecoverable error Fix 'DirectX encountered an unrecoverable error' in Battlefield 2042

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.