App Errors

How to Fix Discord "A Fatal Javascript Error Occurred" Startup Error

A fatal Javascript error occurredPlain English: Discord crashed while starting because something is wrong with its own files on your computer — a corrupted profile or a file it cannot write. Your account and messages are safe on Discord's servers.
Quick answer: Discord's "A fatal Javascript error occurred" dialog means the desktop app broke during launch, almost always because of corrupted files in its AppData folders. Close every Discord process in Task Manager, then press Windows + R, type %appdata%, and delete the Discord folder; repeat with %localappdata% and delete the Discord folder there. Run Discord as an administrator once. If the error survives that, check that your antivirus has not quarantined Discord files, set the qWave service to Automatic, and do a full clean reinstall from discord.com. The full steps with exact paths are below.

What Discord's "A fatal Javascript error occurred" means

You click the Discord icon, the splash screen flashes — or never even appears — and instead of your servers you get a small white dialog box announcing that "A fatal Javascript error occurred." Sometimes it names a culprit, like an EPERM: operation not permitted permission failure or a specific module it could not load. Either way, the result is the same: Discord refuses to open at all.

The wording sounds catastrophic, but the actual situation is usually boring and fixable. The Discord desktop app is built on Electron, which means the whole client runs on a JavaScript engine under the hood. When that engine crashes at startup, it is nearly always tripped by a local problem on your machine: a profile file that went corrupt, an updater state that got interrupted mid-download, or a folder the app is no longer allowed to write to. This is why the error often shows up the morning after a Windows update — the update quietly changes folder permissions, and Discord discovers at next launch that its own workspace is locked.

The most important thing to understand is scope. The error is client-side, not account-side. Nothing about your Discord account, your servers, your DMs, or your settings has been damaged, because all of that lives on Discord's servers. The app is essentially refusing to start because its bedroom is a mess — tidy the bedroom (delete the local folders) and it starts again. That is also why logging into Discord in your browser at discord.com keeps working fine while the desktop app throws this dialog: the browser version does not touch those local files.

Common causes

How to fix Discord's fatal Javascript error — step by step

Work through these fixes in order. Step 3 alone resolves the error for most people; the later steps cover the stubborn cases.

  1. Kill every Discord process and try launching again. Press Ctrl + Shift + Esc to open Task Manager, switch to the Processes tab, and end every entry with Discord in its name — including Update.exe and any crash handlers. The updater sometimes stays alive in the background holding files locked, which is why a simple double-click changes nothing. Once nothing Discord-related is running, launch Discord again and check whether the error dialog still appears.
  2. Run Discord as an administrator. Right-click the Discord shortcut or Discord.exe and choose Run as administrator, then confirm the prompt. Many instances of the fatal Javascript error are really permission failures — the app tries to write to its own folders and the operating system refuses — and running elevated gives it the access it needs. If Discord opens this way, you can make it permanent: right-click the shortcut, choose Properties, open the Compatibility tab, and check Run this program as an administrator.
  3. Delete Discord's AppData folders. This is the fix that works for most people. Close Discord completely, then press Windows + R, type %appdata%, and press Enter. Find the Discord folder and delete it. Then press Windows + R again, type %localappdata%, press Enter, and delete the Discord folder there too. These folders hold your local profile, cache, and updater state — not your account — so Discord simply rebuilds them fresh on the next launch, and whatever corrupted file was triggering the error goes with them.
  4. Remove the read-only attribute from the Discord folder. A Windows update can quietly mark the Discord folder in AppData as read-only, and then Discord cannot modify its own files when it starts — the classic trigger for this exact dialog. Press Windows + R, type %appdata%, and press Enter. Right-click the Discord folder, choose Properties, and look at Attributes at the bottom: if Read-only is checked, uncheck it, click Apply, choose to apply the change to all subfolders and files, and click OK. If the folder keeps reverting to read-only, delete it entirely — Discord recreates it with correct permissions.
  5. Whitelist Discord in your antivirus. Antivirus software occasionally quarantines or blocks Discord's updater and module files, which the app reads as corrupted components and answers with the fatal Javascript dialog. Open your antivirus, look at its quarantine or blocked-items list, and restore anything Discord-related — then add the Discord installation folder to the exclusions list. In Windows Security the path is Settings, then Privacy & security, then Windows Security, then Virus & threat protection, then Manage settings, then Add or remove exclusions under Exclusions. Repeat step 3 afterwards so any already-damaged files are rebuilt.
  6. Set the qWave service to Automatic. The Quality Windows Audio Video Experience service, or qWave, handles network quality-of-service on Windows, and Discord's startup can fail when the service is disabled. Press Windows + R, type services.msc, and press Enter. Scroll to Quality Windows Audio Video Experience, right-click it, and choose Properties. Set Startup type to Automatic, click Start if the service is stopped, then Apply and OK. Restart your computer once and try launching Discord again.
  7. Uninstall and clean-reinstall Discord from discord.com. If every step above fails, do a full clean reinstall. First delete both AppData Discord folders as described in step 3. Then open Settings, go to Apps, then Installed apps, find Discord, and choose Uninstall. Restart your computer. Then download a fresh installer from discord.com/download — not a copy saved on your drive — and run it. A fresh install replaces any broken modules the error message names, such as a corrupt discord_modules folder, and it is the documented last resort short of a new Windows user profile.

Did this fix it? Quick checklist

If Discord launches as administrator but not normally, your Windows user profile has damaged permissions on the AppData folders — step 4's delete-and-rebuild approach permanently solves that, since the rebuilt folder inherits correct permissions. And if the error only appears after Discord updates itself, the culprit is almost certainly the updater state in %localappdata% — clearing that folder right after an update becomes a habit that keeps the dialog away for good. One last tip: after any Windows update, if Discord suddenly will not open, start with step 4 before anything else — the read-only folder issue is the single most common post-update trigger.

Frequently asked questions

What does "A fatal Javascript error occurred" mean on Discord?

It means Discord's desktop client crashed during startup because one of its own local files — a corrupted profile, a module it could not load, or a file the operating system would not let it write — made the app's JavaScript engine fail. Your account, servers, and messages are untouched on Discord's side. The problem lives entirely in the files on your computer, which is why deleting the local folders and reinstalling fixes it.

Will deleting Discord's AppData folder delete my messages?

No. Your messages, servers, friends, and settings that are synced to your account live on Discord's servers, not in your AppData folders. Deleting %appdata%/Discord and %localappdata%/Discord only removes the local cache, updater state, and local preferences. You will be logged out and will need to sign back in, but everything in your account will be exactly where you left it.

Why did the fatal Javascript error appear right after a Windows update?

Windows updates sometimes reset folder permissions, and the Discord folder in AppData ends up marked read-only. When Discord next starts, it cannot write to its own files and the startup crashes with the fatal Javascript dialog. Removing the read-only attribute — or simply deleting the folder and letting Discord rebuild it — resolves this version of the problem.

Can BetterDiscord or other mods cause the fatal Javascript error?

Yes. Client modifications like BetterDiscord inject themselves into Discord's files, and a normal Discord update can leave those injected files in a broken state that triggers the error. If you use mods, run the mod's installer and choose its repair or uninstall option first, then reinstall vanilla Discord. The clean-reinstall step in this guide also removes injected mods as a side effect.

I reinstalled Discord and still get the fatal Javascript error. What now?

A standard reinstall can leave the old AppData folders behind, so delete both Discord folders in %appdata% and %localappdata% before running the fresh installer. If it still fails, the next suspects are an antivirus that keeps quarantining the new files, a pending Windows restart holding the old installation in use, or corrupted permissions on your user profile. The documented last resort is creating a fresh Windows user profile and installing Discord there.