sodcalculator

10 Tech How-To

Fix Discord JavaScript Error: Step-by-Step Guide

Guide 10-44257 · Updated · Step by step

Discord’s JavaScript error usually appears as a blank white screen, a frozen window, or a pop-up saying “JavaScript error” when you try to open the app. This guide walks you through the most common fixes, from clearing the cache to reinstalling, so you can get back to your servers quickly.

What You’ll Need

  • Access to your computer’s file explorer (Windows) or Finder (macOS)
  • Admin rights to uninstall and reinstall programs
  • Your Discord login credentials (email and password) for re-authentication
  • A stable internet connection

Step-by-Step

  1. Fully quit Discord. Right-click the Discord icon in the system tray (bottom-right near the clock on Windows, top-right menu bar on macOS) and select “Quit” or “Exit.” Also check Task Manager (Ctrl+Shift+Esc on Windows) or Activity Monitor (Cmd+Space, type “Activity Monitor” on macOS) and end any remaining Discord processes.
  2. Clear Discord’s cache. Press Windows+R, type %appdata% and hit Enter. Find the “discord” folder, open it, and delete the “Cache,” “Code Cache,” and “GPUCache” folders. On macOS, open Finder, press Cmd+Shift+G, type ~/Library/Application Support/discord, and delete the same three folders. Do not delete the whole discord folder yet—only these cache subfolders.
  3. Restart Discord. Launch Discord normally. If it opens without the JavaScript error, you’re done. If not, continue.
  4. Run Discord as administrator (Windows only). Right-click the Discord shortcut and select “Run as administrator.” If this fixes the issue, right-click the shortcut, go to Properties → Compatibility, and check “Run this program as an administrator.”
  5. Disable hardware acceleration. Open Discord, go to User Settings (gear icon near your avatar), scroll to “Advanced,” and toggle off “Hardware Acceleration.” Restart Discord. If the error prevents you from reaching settings, skip to step 6.
  6. Update Discord. Discord auto-updates, but a stuck update can cause JavaScript errors. Download the latest installer from the official Discord website and run it. The installer will overwrite the existing installation and force a fresh update.
  7. Reinstall Discord completely. Uninstall Discord via Control Panel (Windows) or by dragging it to Trash (macOS). Then delete the remaining folder: %appdata% → “discord” on Windows, or ~/Library/Application Support/discord on macOS. Download a fresh installer from the official site and install it. Log in again.
  8. Check your system date and time. A wrong system clock can break Discord’s certificate validation, which sometimes surfaces as a JavaScript error. On Windows, right-click the clock → “Adjust date/time” → toggle “Set time automatically.” On macOS, System Settings → General → Date & Time → enable “Set time and date automatically.”
  9. Update your graphics drivers. Outdated GPU drivers can trigger rendering errors that Discord misreports as JavaScript issues. On Windows, visit your GPU manufacturer’s site (NVIDIA, AMD, Intel) or use Device Manager. On macOS, update via System Settings → General → Software Update.
  10. Check for conflicting software. Some antivirus or overlay programs (like MSI Afterburner, RivaTuner, or certain VPNs) interfere with Discord. Temporarily disable them one by one and test Discord after each disable.

Common Mistakes

  • Deleting the entire Discord folder instead of just cache subfolders. This wipes your login token and settings, forcing a full re-setup. Only delete the three cache folders in step 2.
  • Skipping the full quit step. If Discord is still running in the background, cache files are locked and cannot be deleted, so the fix appears not to work.
  • Reinstalling without deleting the leftover folder. The uninstaller often leaves the app data behind. If you don’t delete %appdata%\discord or ~/Library/Application Support/discord, the corrupted cache persists and the error returns.
  • Assuming the error is on Discord’s side. While server outages exist, a JavaScript error in the desktop app is almost always local. Check Discord’s status page, but still run through the steps above.
  • Using the web version as a permanent fix. The browser version works temporarily, but it lacks features and may still hit the same error if your system has a deeper issue.

Tips

  • Use the browser version as a stopgap. While troubleshooting, open discord.com in Chrome or Edge to stay connected. This doesn’t fix the desktop app but keeps you reachable.
  • Back up your settings. Before reinstalling, copy the settings.json file from the discord folder to your desktop. After reinstall, close Discord and replace the new settings file with your backup to keep your theme and preferences.
  • Keep Discord updated. Enable automatic updates in Discord’s settings. Stale versions accumulate bugs that get fixed in later releases.
  • Check for Windows/macOS updates. System updates often include fixes for the runtime libraries Discord depends on (like WebView2 or Electron components).
  • Create a fresh Windows user profile. If the error persists only under your user account, a corrupted user profile might be the cause. Testing under a new admin account isolates this quickly.

Troubleshooting

If you’ve followed all steps and the error persists, try these additional checks:

  • Check Discord’s status page. Visit discordstatus.com. If there’s an active outage, the desktop app may fail to load its JavaScript bundles. Wait and retry.
  • Test on a different network. The error can be triggered by a proxy or firewall blocking Discord’s update servers. Temporarily disable your VPN or connect via mobile hotspot to see if the error clears.
  • Run a system file check (Windows). Open Command Prompt as administrator and run sfc /scannow. Corrupted system files can break the Electron runtime Discord uses.
  • Check for malware. Run a full scan with Windows Defender or your preferred antivirus. Some adware injects scripts into apps, causing JavaScript errors.
  • Try the Discord PTB or Canary build. Download Discord PTB (Public Test Build) from the official site. If it works, your stable build is corrupted. You can use PTB temporarily or wait for the next stable update.
  • Reset your router. A corrupted DNS cache can block Discord’s content delivery network. Power-cycle your router, then flush DNS: on Windows, run ipconfig /flushdns in Command Prompt.

Frequently Asked Questions

What exactly causes the Discord JavaScript error?

The most common causes are corrupted cache files, an incomplete update, outdated graphics drivers, or interference from other software. It’s rarely a problem with your actual JavaScript knowledge—it’s the app’s internal scripts failing to load.

Will I lose my messages or servers if I reinstall Discord?

No. Your messages, servers, and friends are stored on Discord’s servers, not on your computer. You only lose local settings like custom themes and keybinds, which you can back up as described above.

Does clearing the cache log me out of Discord?

No. Clearing only the Cache, Code Cache, and GPUCache folders does not remove your login token. You’ll stay logged in. Deleting the entire discord folder, however, will log you out.

Why does the error keep coming back after I fix it?

Recurring errors usually point to a deeper issue: outdated GPU drivers, a failing hard drive, or a conflicting program that re-corrupts the cache. Update your drivers and check which background apps run at startup.

Can I just use Discord in my browser instead?

Yes, the web version at discord.com works for most features, including voice and screen share. It’s a good temporary solution, but the desktop app uses fewer system resources and has better notification integration.

Is this error a sign my computer is infected with a virus?

Not usually. While malware can cause similar symptoms, the Discord JavaScript error is almost always a benign cache or update issue. Still, if you notice other odd behavior (pop-ups, slow performance), run a malware scan.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →