I keep getting a “Discord Fatal Javascript Error” every time I try to open the desktop app on Windows. I’ve already tried reinstalling Discord, clearing AppData, and disabling my antivirus, but the error still pops up and the app won’t launch. Can someone explain what usually causes this and walk me through any reliable steps or advanced fixes to resolve it for good
I had this same fatal Javascript error loop a few months ago. Reinstall alone did nothing. What fixed it for me was nuking every Discord and Discord-related process and file, then fixing corrupted stuff on Windows.
Try this step by step:
-
Kill everything Discord
- Press Ctrl + Shift + Esc.
- Go to Processes.
- End task on any Discord.exe, Update.exe, Squirrel, or anything that looks related.
-
Remove all Discord folders
- Press Win + R, type:
%AppData% - Delete the Discord folder.
- Press Win + R again, type:
%LocalAppData% - Delete any Discord folder there too.
- Also delete:
C:\Users\YourUser\AppData\Roaming\discord
C:\Users\YourUser\AppData\Local\Discord - Empty Recycle Bin.
- Press Win + R, type:
-
Delete the Discord updater and Squirrel leftovers
- Go to:
C:\Users\YourUser\AppData\Local\SquirrelTemp - Delete everything in there.
- If you see “DiscordSetup” in Downloads or Temp, delete those too.
- Go to:
-
Check for corrupted files on Windows
- Press Start, type cmd.
- Right click Command Prompt, run as Administrator.
- Run:
sfc /scannow - Wait for it to finish.
- Then run:
DISM /Online /Cleanup-Image /RestoreHealth - Restart your PC after both.
-
Install Discord fresh
- Go to discord.com in a browser.
- Download the latest stable Windows app.
- Right click the installer, choose “Run as administrator”.
-
If the error pops up again
- Press Win + R, type:
%LocalAppData%\Discord - Open the folder with a version number, like app-1.0.9030.
- Right click Discord.exe, choose “Run as administrator”.
- If that works, the shortcut might point to a broken install. Recreate the shortcut from this exe.
- Press Win + R, type:
-
Check for conflicting stuff
- Some overlay or hook tools break Discord.
- Temporarily disable:
- Overwolf
- Razer Synapse overlay
- MSI Afterburner overlay
- Nahimic or Sonic Studio sound tools
- Restart Discord after each change.
-
Check the log to see what is blowing up
- Go to:
%AppData%\discord\logs - Open the latest .log file with Notepad.
- Look for lines with “Error” around the time you launched it.
- Post the exact error message and stack trace on the thread if you want more targeted help.
- Go to:
If none of that works, easiest workaround is to use Discord PTB or Canary since they install in a separate path.
Links you might need:
Official download:
PTB:
Canary:
Couple more angles you can try that don’t repeat what @kakeru already laid out:
-
Figure out what’s actually crashing (the real error text)
- When the “Discord Fatal Javascript Error” pops, there’s usually more detail like:
EPERM: operation not permittedENOENT: no such file or directoryCannot find module '...’
- Screenshot or copy that exact message. Different text = different cause. For example:
- EPERM often = permissions / AV / something locking files.
- ENOENT often = missing / half‑deleted resources.
- “Cannot find module” = broken or outdated Discord files.
- When the “Discord Fatal Javascript Error” pops, there’s usually more detail like:
-
Check if it is your user profile, not Discord
- Create a new local Windows user account:
- Settings → Accounts → Family & other users → Add someone else.
- Log in with that new user, download Discord, install and run.
- If it runs fine there, the corruption is inside your main Windows profile (registry entries, path issues, or leftover perms), not the global install.
- In that case:
- Check your main profile’s
%AppData%\discordand%LocalAppData%\Discordsecurity permissions:- Right click folder → Properties → Security.
- Make sure your user has Full control.
- If permissions look broken, reset using:
icacls '%AppData%\discord' /reset /Tin an elevated CMD.- Same for
%LocalAppData%\Discord.
- Check your main profile’s
- Create a new local Windows user account:
-
Verify your .NET / Visual C++ stack
- Discord is Electron and uses a bunch of system libs. Corrupted runtimes can trigger what looks like a Javascript error.
- Go to “Apps & Features”:
- Find all Microsoft Visual C++ Redistributable entries.
- Repair them (don’t just uninstall).
- Install latest supported Visual C++ from Microsoft’s site (x86 and x64).
- Also make sure Windows Update is actually up to date, not stuck on a failed patch.
-
Disable weird filesystem stuff
- If you’re using:
- OneDrive “Files on Demand”
- Cloud backup that hooks into AppData
- Third party anti-ransomware controlling folders
- Temporarily:
- Pause OneDrive / backup client.
- Turn off “controlled folder access”:
- Windows Security → Virus & threat protection → Ransomware protection → Controlled folder access → Off (for testing).
- Then try launching Discord again. A lot of those “Fatal Javascript Error” dialogs end up being JS code complaining that it cannot read or write to a file the OS just blocked.
- If you’re using:
-
Try a completely offline install run
- Disconnect from internet (pull cable / disable Wi‑Fi).
- Start
DiscordSetup.exeas admin. - Let it finish, then launch Discord once.
- Sometimes the installer is updating itself mid‑install and if your connection or DNS is flaky, you get a half‑baked build that JS chokes on.
-
Nuke Discord’s GPU usage
- Discord uses hardware acceleration by default, and if your GPU drivers are crusty, JS error can be a side effect of the renderer failing.
- You can force disable hardware acceleration via a shortcut flag:
- Create a shortcut to
Discord.exein%LocalAppData%\Discord\<version>\. - Right click → Properties → Target, append:
--disable-gpu
- Run Discord using that shortcut.
- Create a shortcut to
- Also worth updating GPU drivers from NVIDIA / AMD / Intel directly.
-
Check the Event Viewer for what Windows thinks
- Win + R →
eventvwr.msc. - Windows Logs → Application.
- Filter by “Error” and look for entries with
Discord.exeorSquirrel. - If you see something like
.NET RuntimeorSideBySideerrors around the same time, that points more to system libs rather than Discord itself.
- Win + R →
-
If you’re on some weird drive / path
- Don’t install Discord on a network drive, SD card, or some funky junction point.
- Let it install to the default
%LocalAppData%\Discordon your system drive. - If you previously tried to “portable-ify” it by copying folders around, delete that and stick with the default.
Personally, I’d do this order next:
- Note the exact error text in the JS popup.
- Test with a brand‑new Windows user account.
- Repair Visual C++ and update Windows & GPU drivers.
- Run Discord with
--disable-gpu. - Check Event Viewer + Discord logs for EPERM / ENOENT / module errors.
If you post the specific error line from the fatal JS dialog and maybe a line or two from %AppData%\discord\logs, people can usually pinpoint the cause instead of just saying “reinstall Discord” for the 19th time.
Couple of angles that haven’t been covered yet, focusing less on “nuke & reinstall” and more on environment conflicts.
1. Check for Electron-level conflicts
Discord is just an Electron app. If you have issues with other Electron apps (VS Code, Slack, Teams, etc.) crashing or giving similar JS errors, that points to a shared dependency problem rather than Discord itself.
- Try launching another Electron-based app.
- If it also misbehaves, suspect:
- System-wide environment variables
- Security software hooks
- Third party “optimizer” tools
Temporarily disable any “PC cleaner,” “game booster,” or OS skinning tools that hook into processes.
2. Strip down your startup environment
Instead of only killing Discord processes like @mikeappsreviewer and @kakeru suggested, try a clean boot of Windows:
- Press Win + R → type
msconfig. - Go to Services tab.
- Check “Hide all Microsoft services.”
- Click “Disable all.”
- Go to Startup tab → open Task Manager.
- Disable everything non-essential (RGB, game launchers, overlays).
- Reboot and test Discord.
If it works in this minimal state, re-enable things in batches until you find the culprit.
3. Look at system-wide environment variables
Corrupted or weird %TEMP% / %TMP% or custom PATH entries can break installers and Electron apps in subtle ways.
- Right click Start → System → Advanced system settings.
- Click “Environment Variables.”
- Check:
- User and System
TEMP/TMPpoint to valid folders (usuallyC:\Users\<you>\AppData\Local\Temp). - Those folders exist and are writable.
- User and System
- Clear them out:
- Go to each Temp folder and delete contents you can (skip locked files).
- Try Discord again.
If the JS error mentions temp paths, this is a strong candidate.
4. Check for file system / profile path weirdness
If your Windows username has non‑ASCII characters or you moved your profile to a different drive using junctions or registry hacks, Discord sometimes chokes.
- Confirm your profile path is the default:
C:\Users\<username> - If it is redirected using symlinks or network paths, try:
- Creating a new user with a simple ASCII name.
- Test Discord there (this extends what @kakeru said, but focus on the name/path specifically).
If it only fails on the complex-username profile, the fatal Javascript error might be due to path parsing.
5. Group policy / corporate lockdown scenarios
If this is a work or school machine:
- IT policies can block:
- Running from
%LocalAppData% - Squirrel-based updaters
- Writing to AppData
- Running from
- That can manifest as “fatal Javascript error” instead of a clean “blocked by policy” message.
Open gpedit.msc (if available) and check under:
- Computer Configuration → Administrative Templates → Windows Components → Attach your attention to any policy related to installers, software restriction, or AppData.
If you are under strict policy and cannot change it, the web version is the safest route.
6. Disk / storage subtle issues
Even short of obvious disk failures, bad sectors or flaky SSD firmware can corrupt small files that Discord relies on.
- Run
chkdskon the system drive:- Open CMD as admin.
chkdsk C: /f- Accept reboot.
- If your Discord folders live on a different drive or partition, run
chkdskthere too.
If Event Viewer shows disk-related warnings around Discord crashes, this becomes more likely than a pure JS problem.
7. Competing Electron runtimes or “portable” remnants
If you previously tried a portable Discord or manually copied app folders:
- That can leave broken shortcuts or partial runtimes.
- Search your whole system drive for:
Discord.exeSquirrel.exe
- Delete any stray “portable” or manually copied Discord directories that are not under the standard AppData locations mentioned by @mikeappsreviewer.
8. About the “product” angle and pros/cons
Using the regular desktop Discord app instead of only web has its own pros and cons, which matter here since you are deciding whether to keep fighting this error:
Pros:
- Better performance than browser in long sessions.
- System-level features like push-to-talk and global keybinds.
- Screen share and hardware acceleration features that can be smoother than browser.
Cons:
- More fragile install due to Squirrel and Electron, which is exactly what you are hitting.
- Sensitive to system-level changes, overlays, and weird security tools.
- Needs periodic cleanup if updates or caches get corrupted.
If the desktop version keeps throwing fatal Javascript error even after trying the heavier steps from @mikeappsreviewer and @kakeru plus the environment checks above, it is completely reasonable to:
- Park the desktop app for now.
- Use the browser version long term.
- Revisit the installer only after:
- A major Windows update,
- Driver refresh,
- Or if you rebuild / reset Windows.
At this point, the next debugging move would be: screenshot the exact JS error text and cross-check it with Discord’s logs and Event Viewer. That specific message usually narrows it from “something is wrong” to “this file / permission / path is wrong,” which is the point where further troubleshooting becomes targeted instead of more reinstall cycles.