Download Article
Download Article
If you’re seeing an error that says «a JavaScript error occurred in the main process» or «a fatal JavaScript error occurred» when trying to open or install Discord, there are several potential fixes. While these fixes are designed to resolve this error on Discord, they should work to resolve similar errors in other apps, including Microsoft Teams. We’ll show you how to troubleshoot JavaScript errors for Discord, Microsoft Teams, and other Windows 10 apps.
-
1
Open your antivirus or antimalware software. If you’re unable to install Discord or another app on your PC because of a JavaScript error, such as «a JavaScript error occurred in the main process,» your antivirus software may be blocking the installer. You can fix this by adding an exclusion for the installer.
- If you’re using Windows Security, which comes for free with Windows, type security into the search bar and then click Windows Security.
- The remaining steps will cover unblocking an installer with Windows Security, but your antivirus suite may have different menu options.
-
2
Go to the Virus and threat protection area. This gives you a general overview of your antivirus settings.
Advertisement
-
3
Click Manage settings. This opens the settings for your antivirus protection.
-
4
Add an exclusion for the Discord installer. If you’re using Windows Security, click Add an exclusion, select File, and then open your download folder and select DiscordSetup.exe (or the name of the installer you’re trying to run).
-
5
Run the installer again. Once you’ve allowed the installer to run, you should resolve JavaScript errors that occur during installation.
Advertisement
-
1
Close Discord (or the app you’re trying to fix). If you get a JavaScript error when trying to launch or install Discord or another app, the application data may be corrupt. If the app is running right now, you’ll want to close it so you can properly delete and reinstall it. Make sure it’s not minimized to your taskbar.
- To be sure it’s closed, press Control + Alt + Delete and click Task Manager. If you see a that the app is running, click to select it, and then click End Task.[1]
- Even if you’ve only tried installing the app and were not successful, you should still use this method before you try to install again.
- To be sure it’s closed, press Control + Alt + Delete and click Task Manager. If you see a that the app is running, click to select it, and then click End Task.[1]
-
2
Press ⊞ Win+S. This activates the Windows search bar.
-
3
Type %appdata% and press ↵ Enter. This opens a File Explorer window to your application data.
-
4
Permanently delete the folder for the app you’re trying to fix. For example, if you’re trying to fix Discord, you’ll want to delete the «Discord» folder. Here’s how:
- Click the folder once to select it. Don’t open the folder—just select it for now.
- Hold down the Shift key as you press Delete.
- Click Yes.
-
5
Press ⊞ Win+S. This activates the Windows search bar again.
-
6
Type %LocalAppData% and press ↵ Enter. This opens a File Explorer window to your local app data.
-
7
Permanently delete the app’s folder here as well. Just hold down the Shift key as you press Delete, and then confirm deletion.
- If you don’t see this folder, just skip this step.
-
8
Uninstall Discord (or the app in question) from your PC. Here’s how:
- Open the Windows menu and click the Settings gear.
- Go to Apps > Apps & features.
- Select the app and click Uninstall. If you don’t see the app here, just move to the next step.
- Click Uninstall to confirm.
-
9
Reinstall the app. If you’re reinstalling Discord, you can download the installer from https://discord.com/download. Once downloaded, double-click the installer and follow the on-screen instructions—this should fix just about all installation errors.
Advertisement
-
1
Open your Windows Settings
. If you’re getting an error that says «a JavaScript error occurred in the main process» when trying to install Microsoft Teams, this may indicate a problem with the C++ libraries installed on your PC.[2]
- While this method is known to work for Teams, it may also resolve the same issue in other apps.
-
2
Click Apps. This opens the Settings panel to the Apps list.
-
3
Click Apps & Features. This option is in the left panel.[3]
-
4
Click the latest version of Microsoft Visual C++. You’ll probably see several instances of Visual ++ here—you’ll want to click the one that has the most recent date.
-
5
Click Change or Advanced options. You should see one of these two options here.
-
6
Click Repair. This performs a few repair steps to the C++ libraries.
- If prompted, enter your administrator password to confirm.
-
7
Try running the installer again. This should resolve most JavaScript installation errors with Microsoft Teams on Windows 10.
Advertisement
-
1
Close Discord (or the app you’re trying to fix). If you get a JavaScript error when trying to start Discord or another app, certain processes may be failing because they need more permissions. If the app is running right now, you’ll want to close it. Make sure it’s not minimized to your taskbar.
- To be sure it’s closed, press Control + Alt + Delete and click Task Manager. If you see a process for the app running, click to select it, and then click End Task.
-
2
Right-click the Discord icon on your desktop or in the Windows menu. A menu will expand.
-
3
Click Open file location. If you don’t see this option, you may have to click More first. This takes you to the app’s install location.
-
4
Double-click the latest version of Discord. If you’ve run a few Discord updates, you may have several folders beginning with app- and ending with a number. Double-click the one with the most recent version number.
- If you’re trying to fix a different app, you’ll usually see that app right here in the folder you’ve opened. If not, look around for a file with the app’s name—it may end with «.exe.»
-
5
Right-click the app and select Properties. Properties for the selected app will appear.
-
6
Click the Compatibility tab. It’s at the top of the window.
-
7
Check the box next to «Run this program as an administrator.» This gives the app permission to everything on your PC, which may clear up issues caused by access rights.
-
8
Click OK. This saves your changes.
-
9
Start Discord or your preferred app normally. Now that you’ve set the app to run as an administrator, starting it by double-clicking its icon on your desktop or in the Windows menu will run it with elevated privileges.
Advertisement
Add New Question
-
Question
Why am I getting a Javascript error with WordPress?
Luigi Oppido is the Owner and Operator of Pleasure Point Computers in Santa Cruz, California. Luigi has over 25 years of experience in general computer repair, data recovery, virus removal, and upgrades. He is also the host of the Computer Man Show! broadcasted on KSQD covering central California for over two years.
Computer & Tech Specialist
Expert Answer
Check the website on other devices, like another computer or a tablet. If the same error shows up, there’s an issue with the code that needs to be looked at. It also helps to make sure that Java is up-to-date on your computer, since a lot of people don’t even update Java anymore (since it’s updated with the operating system).
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
About This Article
Article SummaryX
1. Unblock the installer in your antivirus software.
2. Try deleting the app’s folders in AppData and LocalAppData and then reinstalling.
3. Repair the latest version of Microsoft Visual C++ in Apps & Features.
4. Run the app as an administrator.
Did this summary help you?
Thanks to all authors for creating a page that has been read 53,710 times.
Is this article up to date?
Hello Everyone,
While installing Microsoft Teams, the error message described in the subject line is thrown.
Am running Microsoft Windows Version — 1909
A couple of troubleshooting tips found on https://docs.microsoft.com/en-us/MicrosoftTeams/troubleshoot-installation have been tried but the error still shows up.
Any idea on how to resolve this issue will be greatly appreciated.
UPDATES
I did a comparison of 2 SquirrelSetup.log files. (Both PC runs Windows 1909 and the same build number.
The PC 1(Throwing up the JavaScript error above)logged some issues not found in the PC 2 as shown below:
—-start—-
ApplyReleasesImpl: Couldn’t run Squirrel hook, continuing: C:\Users\Administrator\AppData\Local\Microsoft\Teams\current\Teams.exe:
System.OperationCanceledException: The operation was canceled.
at System.Threading.CancellationToken.ThrowOperationCanceledException()
at Squirrel.Utility.<>c__DisplayClass11_0.<InvokeProcessAsync>b__0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotificat ion(Task task)
at Squirrel.Utility.<InvokeProcessAsync>d__11.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotificat ion(Task task)
at
Squirrel.UpdateManager.ApplyReleasesImpl.<>c__DisplayClass18_1.<<invokePostInsta ll>b__2>d.MoveNext()
—end—-
FURTHER UPDATES
Many suggestions found on GitHub, Microsoft support site, blogs and other websites have been tried. So after spending several hours googling and searching for a working solution, the following finally worked on the PC in question.
- A standard user account was created on the PC.
- Downloaded a new Microsoft teams app.
- In services.msc, the status of a service called Quality Windows Audio Video Experience was also manually started.
- Executed the app and no JavaScript error was thrown.
N.B: I am still not satisfied with this fix, cos i applied the same troubleshooting approach on another PC throwing up the same JavaScript error, and the fix doesn’t work on it.
Появление кода этого программного сбоя свидетельствует о завершении рабочего сеанса голосового мессенджера. Это довольно распространенная ошибка, с которой часто сталкиваются пользователи операционной системы Windows. Появление фразы «JavaScript error occurred in the main process» можно расценивать в качестве оповещения о некорректной работе программного обеспечения или конкретных системных служб. Этот сбой можно устранить самостоятельно. Придерживайтесь экспертных рекомендаций и инструкций, чтобы сделать все правильно.
Скриншот ошибки JavaScript
Причины появления ошибки
В коде программного сбоя всегда зашифрована причина возникновения ошибки. В данном случае оповещение свидетельствует о некорректной работе определенных сценариев JavaScript. Почему ошибка появляется именно при работе с Discord? Это обусловлено тем, что мессенджер создан на основе языка программирования Java.
Появление сбоя может также стать следствием повреждения системных файлов софта. Возможно, важные файлы были случайно удалены пользователем или заблокированы антивирусом, поэтому мессенджер Discord не работает. Практика показывает, что зачастую появление ошибки связано с отсутствием файла под названием «discord_voice». Впрочем, есть и другие причины:
- мессенджер конфликтует с программным обеспечением, которое было установлено на ноутбук или ПК;
- деинсталляция прежней версии Discord была выполнена некорректно. Остатки некоторых файлов создают проблемы в работе;
- не установлены компоненты операционной системы Windows последней версии, нужно включить автоматическую инсталляцию обновлений;
- некорректная работа мессенджера спровоцирована вирусами или шпионским ПО.
Ошибка работы приложения Дискорд
Чтобы точно определить причину, нужно провести тщательную диагностику.
Решение проблемы
Для устранения ошибки, откройте корневую директорию мессенджера. Найдите директории с названием «AppData» и «AppDataLocal». Из-за стандартных настроек ОС они могут быть недоступны для просмотра. Чтобы получить доступ к данным папкам, сделайте следующее:
- Зайдите в меню «Пуск» или воспользуйтесь комбинацией горячих клавиш «Win+R».
- Нажмите на «Выполнить».
Окно «Выполнить»
- В появившемся окошке следует вписать команды «%localappdata%» и «%appdata%», которые откроют доступ к скрытым директориям.
- Удалите абсолютно все файлы в этих папках, в названии которых встречается «Discord».
- Из мессенджера также необходимо выйти. Самый действенный способ – принудительно отключить все процессы через «Диспетчер задач».
- Удалите мессенджер, а потом установите программу заново.
Этих действий достаточно для решения проблемы и восстановления корректной работы программного обеспечения.
Альтернативные варианты устранения ошибки
Ранее было отмечено, что стать катализатором появления программного сбоя способны также стать вирусы. Для исключения этой вероятности, проверьте корневую директорию мессенджера Discord. Сначала закройте данную программу через «Диспетчер задач», а уже потом запускайте антивирус. Если зараженные файлы были обнаружены, удалите их, а потом повторно запустите голосовой чат. Во избежание появления дополнительных сбоев, всегда запускайте мессенджер от имени администратора.
Установите на PC или лэптоп актуальную версию ОС Windows, на которую регулярно выходят официальные обновления Microsoft. Сегодня разработчики американской компании исправно обновляют только восьмерку и десятку. Поэтому выберите одну из этих операционок. Голосовой чат Discord – это относительно новое программное обеспечение, использующее современные службы и компоненты. Старые версии операционной системы не поддерживают их, поэтому возникают всевозможные сбои и ошибки.
Проблемы с запуском Skype
У некоторых пользователей ошибка «Javascript error occurred in the main process» возникает при запуске программы Skype. Появление сбоя обусловлено тем, что операционная система пытается выполнить автозагрузку приложения, то есть открыть программу сразу после включения ноутбука или компьютера.
Автоматический запуск Skype предусматривает дополнительное взаимодействие с Javascript, что неудивительно, ведь рассматриваемая программа написана именно на этом языке программирования. В коде сбоя указан проблемный сценарий, который следует устранить для восстановления корректной работы системы.
Довольно часто советы по устранению ошибки сводятся к обновлению Java и сбросу пользовательских настроек браузера Internet Explorer. Однако все эти действия не помогут избавиться от сбоя. Решение проблемы лежит на поверхности. Запустите Skype и перейдите в раздел настроек. На вкладке общие вы найдете команду «Запускать Скайп автоматически». Отключите эту функцию.
Отключение автозагрузки в Скайпе
Ошибка исчезнет, но программа не будет включаться при запуске компьютера. Если автозагрузку Скайпа нужно сохранить, тогда зайдите в меню «Пуск». Перенесите иконку Skype в директорию Автозагрузка. Сделать это можно просто перетянув ярлык в нужную папку.
Папка «Автозагрузка»
Заключение
Теперь вы знаете, как исправить ошибку «JavaScript error occurred in the main process» и почему этот программный сбой появляется. В целях профилактики старайтесь своевременно обновлять операционную систему, а также весь софт. Это позволит избежать возникновения различных ошибок.
Оценка статьи:
Загрузка…
Sometimes when you try to open an application in Windows it may pop an error “A javascript error occurred in the main process” Most of the time it happens with chatting apps like Discord, Skype, or Microsoft Team but maybe it happens with VSCode or Forticlient VPN.
It doesn’t matter which application cause this error for you, matter how you can fix it with minimum effort. In this article, I share the exact way to fix this error.
All the articles on this topic have the almost same content but all of them still missing one thing that may the reason for you.
What causes the ‘A JavaScript Error Occurred in the Main Process’ error?
- Your program or its settings may have gone corrupt
- The Quality Windows Audio Video Experience service is not running
- Your app runs with administrator permissions
- You don’t have the right version of Microsoft Visual C++ Redistributable
How to fix the “A javascript error occurred in the main process” error?
- Ensure that you have the Microsoft Visual C++ Redistributable
Very Important Note: If you are not sure about it don’t worry just leave it for now, follow the rest steps but after that, if you still have the same error then download Microsoft Visual C++ Redistributable.
- Open Run program by searching it.
- Type “%appdata%” in the Run window
- Press Enter, it will open a folder
- Search for the application folder (In our case it’s the folder name is “Discord” because in our case Discord cause this error).
- Delete it by right-clicking on it and then choosing the delete option.
- Close that window
- Open the Run program again.
- Type “%localappdata%” in the Run window
- Press Enter, it will open a folder.
- Search for the application folder (In our case it’s the folder name is “Discord” because in our case Discord cause this error).
- Delete it by right-clicking on it and then choose the delete option.
- Close that window
- Now, Open Services by searching it
- Scroll and find a service called “Quality Windows Audio Video Experience”
- Right-click on it and select Properties
- Select the Automatic option under the Startup type
- If the service is started (you can check that just next to the Service status message), you should stop it by clicking the Stop button in the middle of the window. Anyway, run it again by clicking the Start
- (Optional) If you see an error when clicking on Start follow this step. Navigate to the Log On tab and click on the Browse button, Under the “Enter the object name to select” entry box, type in your account’s name, click on Check Names Click OK when you are finished, and type in the password in the Password box
- Now, Uninstall the application and install it again (if the error is not resolved)
The below steps are only for Discord
- After reinstalling Discord, search for Discord
- Then right-click on it
- Click on “Open file location” from the menu
- It will open a folder with Discord selected.
- Right-click on the Discord.exe (automatically selected file).
- Click on Properties
- Go to the Compatibility tab
- Uncheck the “Run this program as an administrator” option
- Click on OK
If you still have the error go to step 1 you may forget about it.
Let me know if this article does not help you to solve the problem.
In conclusion, the “A JavaScript Error Occurred in the Main Process” error can be quite frustrating, but it can be fixed easily by following the steps mentioned in this article. It is important to note that different applications may have different solutions, so it is crucial to follow the steps that are specific to your application. In case you are not sure about the Microsoft Visual C++ Redistributable or any other step, it is better to skip it and follow the rest of the steps. If you still face the error after following all the steps, it is recommended to contact the application’s support team for further assistance. Hopefully, this article has helped you fix the issue and get back to using your favorite application without any errors.
Windows users are getting an Uncaught Exception error message – A JavaScript error occurred in the main process. It is triggered when they try to launch some apps on Windows 10 including messaging apps Discord and Skype.
The main cause of this error is not really clear, however, the main reason could be that the app, its database or its settings are corrupted.
Here Are Some Possible Causes for this JavaScript Error?
- App settings or the app itself is corrupted
- The Quality Windows Audio Video Experience service is not active
- The app runs with administrator priviledges
How to Fix A JavaScript error occurred in the main process Error?
Method 1 – Run the App without Administrator Privileges
For some weird reason, the app actually works when a user is not logged in using an administrator account. It gives away that the cause of this error might be the administrator permissions.
Running Discord for instance, without admin permissions resolved the problem for some users. So, here are some to steps to do it:
- Find the Discord executable file and change its properties by right-clicking on it and selecting Properties. Click the Compatibility tab in the Properties window and clear the Run this program as administrator checkbox before applying the changes.
- Make sure that you confirm all dialog boxes that appear to confirm your changes, and Discord should now run without administrator permission. Open it by double-clicking on the icon and try to check if the error persists.
Method 2 – Delete the app data folders in %AppData% and %LocalAppData%.
You can try to reset the app settings by deleting the %AppData% and %LocalAppData% folders. By doind this, it is possible to resolve the JavaScript error which is giving you an error when launching the app.
How to delete these two folders? Here’s how to do it:
- Launch Windows Explorer and click on This PC and then navigate to the following location:
- C:\Users\%username%\AppData\
- Replace the placeholder with the name of the app giving the JavaScript error.
- Sometimes, you may need to enable the option that allows you to view hidden files and folders in order to see the AppData folder.
- Delete the app folder in the AppData folder.
- Next, press the Windows Key + R key combination to launch the Run dialog box. Enter the variable below.
- %localappdata%
- Locate the erring app folder in the folder that opens, click Delete.
Verify if the ‘A JavaScript Error Occurred in the Main Process’ is still there after restarting your computer. One thing to note, it is important to be thorough in this process by making sure that the every file, subfolders in the app folders are totally deleted. There should be no files that should remain in it.
Method 3 – Enable Quality Windows Audio Video Experience Service Automatically
- Press Windows + R
- Type in services.msc
- Right-click on the Quality Windows Audio Video Experience and select Properties
- In the Startup Type drop-down menu, select Automatic
If ever you get an error like this one:
Windows could not start the service on Local Computer. Error 1079: The account specified for this service differs from the account specified for other services running in the same process.
Then you can follow these steps:
- Press Windows + R
- Type in services.msc
- Right-click on the Quality Windows Audio Video Experience and select Properties
- Hit the Log On tab
- Click the Browse button
- In an entry box labeled Enter the object name to select
- Type your Microsoft Windows account’s name in it
- Press Check Names
- Wait for your name to pop up and press Ok
- Type in your Windows account’s password in the Password box
Method 4 – Reinstall the App
If a JavaScript error is still persistent and nothing works from the methods above, the last recourse is to try to uninstall the app (Discord or Skype).
Here’s how to do it:
- Log in to your PC as an administrator
- Open Control Panel
- Set the View by to Category and then click Uninstall a program.
- Find Discord or Skype and then right-click it to choose Uninstall.
After uninstalling the app successfully, visit the Discord or Skype website or go to the Microsoft Store on Windows 10 to download and reinstall the latest version.
Conclusion
By following these methods we have listed above, we hope that the “A JavaScript error occurred in the main process” problem will be completely gone and fixed.