Ошибка дискорд runtime error

I am trying to create a Discord bot with Python, however whenever I run the sample code here:

import discord

client = discord.Client()

@client.event
async def on_message(message):
    # we do not want the bot to reply to itself
    if message.author == client.user:
        return

    if message.content.startswith('!hello'):
        msg = 'Hello {0.author.mention}'.format(message)
        await client.send_message(message.channel, msg)

@client.event
async def on_ready():
    print('Logged in as')
    print(client.user.name)
    print(client.user.id)
    print('------')

client.run('tokenhere')

It returns the error:

Traceback (most recent call last):

  File "<ipython-input-6-ea5a13e5703d>", line 1, in <module>
    runfile('C:/Users/User/Pictures/rito_bot.py', wdir='C:/Users/User/Pictures')

  File "C:UsersUserAnaconda3libsite-packagesspyder_kernelscustomizespydercustomize.py", line 703, in runfile
    execfile(filename, namespace)

  File "C:UsersUserAnaconda3libsite-packagesspyder_kernelscustomizespydercustomize.py", line 108, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Users/User/Pictures/rito_bot.py", line 22, in <module>
    client.run('token')

  File "C:UsersUserAnaconda3libsite-packagesdiscordclient.py", line 595, in run
    _cleanup_loop(loop)

  File "C:UsersUserAnaconda3libsite-packagesdiscordclient.py", line 97, in _cleanup_loop
    loop.close()

  File "C:UsersUserAnaconda3libasyncioselector_events.py", line 94, in close
    raise RuntimeError("Cannot close a running event loop")

RuntimeError: Cannot close a running event loop 

Every other line seems to run just fine, but without the last line it doesn’t connect to the server, which makes it useless.

Note: I have seen the question here, however OP’s solution doesn’t seem applicable to my situation.

Summary

On closing the connection to Discord, it sometimes throws a RuntimeError: Event loop is closed. From what I’ve seen, this happens about 90% of the time. I’ve tested it using CTRL+C to shut the bot down, but not with a shutdown command. (EDIT: A friend gets this same issue using the logout() method as explained in a below comment).

Reproduction Steps

It’s happened in a few different scenarios, but this is enough to set it off from what I’ve seen.

async def shutdown(self):
        print(" Closing connection to Discord...")
        await super().close()

async def close(self):
        print("Closing on keyboard interrupt...")
        await self.shutdown()

Expected Results

The bot closes it’s connection to Discord. This does sometimes happen perfectly fine.

Actual Results

This error:

Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x0000014D19B61280>
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000014D18E1FC10>
Traceback (most recent call last):
  File "C:Program FilesPython38libasyncioproactor_events.py", line 116, in __del__
    self.close()
  File "C:Program FilesPython38libasyncioproactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:Program FilesPython38libasynciobase_events.py", line 719, in call_soon
    self._check_closed()
  File "C:Program FilesPython38libasynciobase_events.py", line 508, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

The program does always exit, but I feel like this error isn’t supposed to happen, especially as it doesn’t occur in versions 1.3.4 and below.

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

System Information

  • Python v3.8.5-final
  • discord.py v1.4.0-final
  • aiohttp v3.6.2
  • system info: Windows 10 10.0.19041

Posted by6 years ago

Archived

I had discord working and then it stopped after some use. I can’t delete the %appdata% completely and the setup doesn’t start. Says can’t find ‘discord_toaster’ when trying to boot discord. Setup causes a runtime error. Any help?

This thread is archived

New comments cannot be posted and votes cannot be cast

no comments yet

Be the first to share what you think!

About Community

Subreddit Icon

Imagine a Place… where you can belong to a school club, a gaming group, or a worldwide art community. Where just you and handful of friends can spend time together. A place that makes it easy to talk every day and hang out more often.



Many users are facing discord JavaScript error on startup and even while streaming with an error message of “A JavaScript error occurred in the main process” with discord uncaught exception.

Most of the users complained that they even restarted and reinstalled discord but still having the same issues. In this article, I am covering all possible methods that will fix this JavaScript error.

So, whenever you pull up discord you get a fatal error of JavaScript and that is mostly on windows 10.

discord a fatal javascript error occurred

discord a fatal javascript error occurred

What does JavaScript Error mean?______________________________

JavaScript error mostly occurs while browsing on the Internet or while installing or opening any windows applications.

There are two types of JavaScript error, Syntax and Runtime Error.

Discord JavaScript error is a runtime error that occurs when the script is unable to complete the instructions and which means there is something that is stopping the JavaScript to proceed.

Causes behind Discord JavaScript Error on Startup

Let me share a few possible causes behind this error that will also help to fix the problem.

Running Discord as an Administrator:- Sometimes running apps with administrative privileges gives an error like JavaScript. Most of the time our programs run as an administrator and probably this can be the cause.

Discord files are corrupted or damaged:- Chances are that discord files got corrupted due to which application fails to start and gives an error. These corrupted files can also cause problems in starting the application and discord stuck on the starting screen.

Problem with Windows Quality audio video Service:- If the quality windows audio video experience service is not running or running in the manual mode, it can be another cause behind JavaScript error discord on windows 10.

Issues with Windows:- This error can also be because of windows corrupted files or infections. 

How to Fix Discord JavaScript Error on Startup

I am very sure these 7 steps of the solution will surely fix this error of discord while start-up or installing discord.

Please do not skip any of the steps, and follow the below steps properly.

SOLUTION 1:- Completely Close Discord

Many backgrounds running files create problems while starting discord and can also become a cause of discord JavaScript error on startup.

In this step, you need to completely close all the background running apps and files of discord. Follow the below steps.

Press Ctrl + Shift + Esc key to bring task manager or make a right-click on the taskbar and choose task manager.

Now in the task manager click on the Details tab and close all the discord-related files by making a right-click on the app and then click on end task.

End all tasks from task manager

End all tasks from task manager

Make sure that you have closed all the discord files, you can also check in the process tab. Once done let’s move to step no 2.

SOLUTION 2:- Run Discord without Admin Rights to Fix Discord JavaScript Error on Startup

There are few applications that work absolutely fine when run without admin rights, as many users got their issues of JavaScript error fixed by running discord without admin rights.

In this process, you need to revoke the admin rights of the discord app, which can be done by the following steps.

Right-click on the discord app and then choose properties.

From the discord properties, click on the Compatibility tab. In the compatibility box at the bottom in the setting section, you will find “Run this program as an administrator”, uncheck the box and then click on Apply and Ok.

How to Fix Discord JavaScript Error

How to Fix Discord JavaScript Error

You may need to repeat this step at the end of troubleshooting.

SOLUTION 3:- Change Start-up Settings of Quality Windows Audio Video Experience

Quality windows audio-video experience settings in windows 10 contain start-up settings which can also create conflicts and errors on discord or any other programs.

This is another tested solution which worked for many discord users to fix JavaScript error on startup.

Here in this solution, we will change the quality windows audio video experience startup from manual to automatic.

Press Windows + R key to open the RUN box, type services.msc and click on Ok to open windows services.

How to open services in windows 10

How to open services in windows 10

Once the windows services box is up, scroll down to the bottom to find Quality Windows Audio Video Experience. Make a right-click on it and choose properties.

Discord javascript error occurred in the main process

A discord javascript error occurred in the main process

In the properties, sections look for the running status and click on Stop to stop the service. Now click on start-up type and from the drop-down choose automatic.

Discord javascript error windows 10

Discord javascript error windows 10

Now click on Start again to start the services and click on Apply and ok. Restart the computer to see the changes. I would recommend that you apply all the solutions.

SOLUTION 4:- Run Windows Hard disk Scan

Technically, any corrupted or damaged system files can also cause JavaScript error while opening any apps on windows 10.

Here we will use the system file checker tool to repair the system files, follow the below steps.

Type Windows power shell in the windows search and click on run as administrator to launch power shell.

How to open windows power shell

How to open windows power shell

Now type the below commands one by one and wait for sometime after each command to get completed.

    • DISM.exe /Online /Cleanup-image /Scanhealth
    • DISM.exe /Online /Cleanup-image /Restorehealth
    • DISM.exe /online /cleanup-image /startcomponentcleanup
    • sfc /scannow

Discord javascript error windows 10

Discord javascript error windows 10

Once the commands are completed, restart the computer and try opening discord, if still doesn’t work move to the next solution.

SOLUTION 5:- Disable Anti-Virus & Firewall to Fix Discord JavaScript Error on Startup

Antivirus and Firewall programs are to block unwanted programs and connections, but sometimes unintentionally it blocks a few of the system or app files.

In order to verify this, we will temporarily disable the Antivirus programs. You might be using third party security programs like Norton and Avast but here I am explaining for windows defender security.  

Type Windows security in the windows search and open the app. In the windows security, click on Virus & Threat protection.

Disable Virus and threat protection in windows

Disable Virus and threat protection in windows

In the next windows, scroll down to Virus and Threat protection settings and click on Manage settings.

better discord javascript error

dsiable real time protection

Look for Real-time protection and disable it by clicking on the blue switch.

SOLUTION 6:- Uninstall Discord and Discord Data Files

So far you are done with many troubleshooting parts and now reinstalling discord after uninstalling discord and its data may work absolutely fine.

 Press Windows + R key to open the RUN box, type appwiz.cpl and click to open the program and features.

Uninstall discord

Uninstall discord

A list of all the programs will be displayed, look for discord, right-click on it, and choose to uninstall.

Once done close the box and press the Windows + R key again to open the run box, type %appdata%, and click on ok. Look for the discord folder, right-click on it and choose delete.

discord javascript error on startup

discord javascript error on startup

Open the RUN box again, type %localappdata%, and click on ok. Look for the discord folder and delete it by making a right-click on it, choose delete.

Now restart the computer and visit the discord official website to download the discord again.

SOLUTION 7:- Restore the Device to Fix Discord JavaScript Error on Startup

I am very sure if you have applied all the above solutions you just got rid of the discord JavaScript error on start-up till now.

If by any chance nothing worked for you I would recommend without going further to any more technical troubleshooting steps kindly restore your device to an earlier time when your device was working fine.

Press Windows + R key to open RUN box and type rstrui.exe to open restore wizard. System restore box will now be up, click on Next.

restore windows 10

restore windows 10

Now you will see all the restore points created on your device, you can also check the box to show more restore points to see all the restore points.

Choose one of the dates when you think your discord was working fine and click on Next to proceed. Click on Finish and wait till the restore is completed.

FINAL WORDS

As far as I know, the above solutions to fix discord JavaScript error on startup worked for many discord users and will work for you as well.

You may have issues of JavaScript error with better discord as well, where I would recommend you to perform the same solutions and also update your discord and download an updated version of better discord.

Please perform all the solutions one by one and repeat solution no 2 in the end again. Let me know in the comment box which solution worked for you in the comment box.

Do let me know if still you are facing this problem and try opening other apps on your device, if you face the same issue with other apps and programs it means the problem is with your device.

I’m developing a Discord bot in Python 3 and can’t get it running properly. I’m hosting the bot on a 1&1 server, booting it with nohup python3 main.py &. The bot is running and working perfectly for a while then crash with every times a huge Traceback of errors ending with RuntimeError: can't start new thread.. And furthermore the source line of the error from my code isn’t the same each time. It always comes from an await [...] line.

I’ve been searching for a while on internet but other developers using import threading and related functions while I don’t, i’m only using the async / await keywords. Is this a mistake ? I’m certain that i don’t reach the thread limit, i’ve been testing my bot with only a few friends, so a maximum of 3 to 4 requests at a time. The bot is using asynchronous methods only for sending messages or reactions on Discord, there is no recursion anywhere.

Here is one of the multiple Traceback i’ve had. Hope somebody can help me, thanks !

`

Ignoring exception in on_message
Traceback (most recent call last):
  File "/kunden/homepages/44/d758963141/htdocs/.local/lib/python3.7/site-packages/discord/client.py", line 333, in _run_event
    await coro(*args, **kwargs)
  File "main.py", line 261, in on_message
    await message.channel.send(lines + "```")
  File "/kunden/homepages/44/d758963141/htdocs/.local/lib/python3.7/site-packages/discord/abc.py", line 905, in send
    nonce=nonce, allowed_mentions=allowed_mentions)
  File "/kunden/homepages/44/d758963141/htdocs/.local/lib/python3.7/site-packages/discord/http.py", line 185, in request    async with self.__session.request(method, url, **kwargs) as r:
  File "/kunden/homepages/44/d758963141/htdocs/.local/lib/python3.7/site-packages/aiohttp/client.py", line 1012, in __aenter__
    self._resp = await self._coro
  File "/kunden/homepages/44/d758963141/htdocs/.local/lib/python3.7/site-packages/aiohttp/client.py", line 483, in _request
    timeout=real_timeout
  File "/kunden/homepages/44/d758963141/htdocs/.local/lib/python3.7/site-packages/aiohttp/connector.py", line 523, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/kunden/homepages/44/d758963141/htdocs/.local/lib/python3.7/site-packages/aiohttp/connector.py", line 859, in _create_connection
    req, traces, timeout)
  File "/kunden/homepages/44/d758963141/htdocs/.local/lib/python3.7/site-packages/aiohttp/connector.py", line 967, in _create_direct_connection
    traces=traces), loop=self._loop)
  File "/kunden/homepages/44/d758963141/htdocs/.local/lib/python3.7/site-packages/aiohttp/connector.py", line 830, in _resolve_host
    self._resolver.resolve(host, port, family=self._family)
  File "/kunden/homepages/44/d758963141/htdocs/.local/lib/python3.7/site-packages/aiohttp/resolver.py", line 30, in resolve
    host, port, type=socket.SOCK_STREAM, family=family)
  File "/usr/lib/python3.7/asyncio/base_events.py", line 789, in getaddrinfo
    None, getaddr_func, host, port, family, type, proto, flags)
  File "/usr/lib/python3.7/asyncio/base_events.py", line 752, in run_in_executor
    executor.submit(func, *args), loop=self)
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 160, in submit
    self._adjust_thread_count()
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 181, in _adjust_thread_count
    t.start()
  File "/usr/lib/python3.7/threading.py", line 847, in start
    _start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread

`

===== EDIT =====

Here is a sample of my code :

`

@client.event
async def on_message(message) :
    global messagesId
    # ===== Block self messages =====
    if message.author == client.user :
        return
    # ===== $register =====
    elif message.content == "$register" :
        if not(await isRegistered(message.author.id, message.channel)) :
            try :
                refreshDb()
                sql = "INSERT INTO player VALUES (%s, %s, 0)"
                dbCurs.execute(sql, (message.author.id, message.author.name))
                sql = "INSERT INTO schedule(player_id) VALUES (%s)"
                dbCurs.execute(sql, (message.author.id))
                db.commit()
            except Exception as e :
                await message.channel.send("Erreur interne #9")
                raise e
            await message.channel.send("Tu as été enregistré.")
        else :
            await message.channel.send("Tu es déjà enregistré.")
# ===== $schedule =====
elif message.content == "$schedule" :
    # Get player's current schedule
    data = None
    try :
        if await isRegistered(message.author.id, message.channel) :
            try :
                refreshDb()
                sql = "SELECT * FROM schedule WHERE player_id = %s"
                dbCurs.execute(sql, (message.author.id))
                data = dbCurs.fetchall()[0]
            except Exception as e :
                await message.channel.send("Erreur interne #4")
                raise e
        else :
            await message.channel.send("Tu dois t'enregistrer pour utiliser cette commande.")
            return
    except Exception as e :
        await message.channel.send("Erreur interne #5")
        raise e
    # Create lines
    text = "<@{}>n{}".format(message.author.id, getScheduleText(data, 1))
    sentMessage = await message.channel.send(text)
    # register message's id
    messagesId[sentMessage.id] = message.author.id
    # Add reactions
    i = 0
    keys = list(cols.keys())
    for key in keys :
        await sentMessage.add_reaction(bytes.decode(numbers[i]))
        i += 1
    # Register every messages id and delete everyone after 60 sec
    await deleteSched(sentMessage)

`

Содержание

  • Общие рекомендации
  • Вариант 1: Уведомление с «Installation has failed»
  • Вариант 2: Появление сообщения «Update Failed»
  • Вариант 3: Ошибка с kernel32.dll
  • Вариант 4: Отсутствие d3dcompiler_47.dll
  • Вариант 5: Ошибка «Error 502»
    • Способ 1: Проверка статуса сервера Discord
    • Способ 2: Отключение брандмауэра Windows
    • Способ 3: Сброс кеша DNS
  • Вариант 6: Ошибка «A JavaScript error occurred in the main process»
    • Способ 1: Очистка остаточных файлов Discord
    • Способ 2: Очистка ПК от мусора
  • Вопросы и ответы

Ошибка при установке Дискорда

Общие рекомендации

Если Discord не устанавливается на компьютер, но при этом никаких сообщений с текстом ошибки не появляется, сначала следует выполнить общие рекомендации. Их достаточно много, поэтому рекомендуем начать с первого, самого легкого способа — так вы сэкономите время и не выполните лишних действий при поиске неполадки.

Подробнее: Решение ошибок при установке Discord в Windows 10
Использование общих рекомендаций для решения ошибки при установке Discord на компьютер

Если у вас установлена одна из предыдущих версий операционной системы, принцип действий немного поменяется, поскольку у устаревших ОС иногда наблюдаются проблемы с совместимостью или отсутствием дополнительных библиотек. Обладателям Windows 7 советуем ознакомиться с другими инструкциями, кликнув по следующему заголовку.

Подробнее: Решение проблем с установкой Discord в Windows 7

Вариант 1: Уведомление с «Installation has failed»

«Installation has failed» — одна из самых популярных ошибок, появляющаяся при попытке установить Дискорд на компьютер. Ее текст говорит о том, что инсталляция не удалась, но он не раскрывает причину, поэтому ее придется искать самостоятельно. Самый простой вариант — проверить процессы и очистить файлы предыдущей версии программы, однако это может не помочь. Тогда придется применить более сложные способы или даже перейти на бета-версию, тестируя ее работу в операционной системе.

Подробнее: Решение ошибки «Installation has failed» при установке Discord на компьютер

Использование рекомендаций для решения ошибки Installation has failed при установке Discord на компьютер

Вариант 2: Появление сообщения «Update Failed»

Казалось бы, установка прошла успешно, но при первом же запуске мессенджера появляется ошибка с текстом «Update Failed», которая свидетельствует о том, что попытка загрузить последнее обновление завершилась провалом. Обычно с такой проблемой сталкиваются те пользователи, которые установили на свой ПК предыдущую версию программы, а она запустила автоматическое обновление при запуске, но не смогла установить найденные файлы. Есть целых шесть разных методов решения этой ситуации, и о них вы узнаете далее.

Подробнее: Решение ошибки «Update Failed» при запуске Discord

Использование рекомендаций для решения ошибки Update Failed при установке Discord на компьютер

Вариант 3: Ошибка с kernel32.dll

Полный текст ошибки выглядит как «Точка входа в процедуру в библиотеке kernel32.dll не найдена». Упомянутый файл является системным, поэтому не стоит думать, что он просто отсутствует в Виндовс и его можно скачать со сторонних сайтов. Во-первых, многие из таких веб-ресурсов распространяют вирусы под видом динамически исполняемых библиотек, во-вторых, это вряд ли принесет должный результат, поскольку файл есть в ОС, но почему-то не работает. Разобраться в этом поможет другая статья на нашем сайте.

Подробнее: Решение проблемы с kernel32.dll

Использование рекомендаций для решения ошибки kernel32.dll при установке Discord на компьютер

Вариант 4: Отсутствие d3dcompiler_47.dll

Отсутствие файла d3dcompiler_47.dll, который является частью дополнительного компонента DirectX, тоже может стать причиной проблем с установкой Дискорда на компьютер. Обладатели Windows 10 редко сталкиваются с этой ошибкой, поскольку все необходимые библиотеки устанавливаются автоматически, но в «семерке» такое уведомление — не редкость. Решить данную ошибку можно как загрузкой отдельно этого файла, так и установкой всей библиотеки.

Lumpics.ru

Подробнее: Исправление проблем с отсутствием d3dcompiler_47.dll

Использование рекомендаций для решения ошибки d3dcompiler_47.dll при установке Discord на компьютер

Вариант 5: Ошибка «Error 502»

Ошибка с кодом 502 говорит о том, что установить соединение при попытке установить связь со службами мессенджера не удалось. Она может появиться как во время установки, так уже и при использовании программного обеспечения. Для ее решения есть несколько доступных методов, которые мы и хотим рассмотреть далее.

Способ 1: Проверка статуса сервера Discord

Существует вероятность того, что рассматриваемая ошибка является глобальной и касается всех серверов Discord. Перед тем, как перейти к манипуляциям со своим компьютером, рекомендуем проверить это предположение, выполнив всего несколько несложных действий.

  1. Для начала откройте официальную страницу Discord в любом браузере и дождитесь ее загрузки. Если содержимое отображается корректно, переходите к следующему шагу. Если же вы увидели ошибку 502 в таком представлении, как она показана на следующем скриншоте, значит, Дискорд пока не работает и нужно дождаться исправления неполадки разработчиками, что обычно занимает не дольше нескольких часов.
  2. Проверка работы серверов для решения ошибки Error 502 при установке Discord на компьютер

  3. Воспользуйтесь ссылкой ниже, чтобы перейти на сайт Discord Downdetector, где нажмите кнопку, чтобы сообщить о возникшей проблеме при установке Discord.
  4. Перейти на сайт Discord Downdetector

    Кнопка отправки сообщения об ошибке для решения ошибки Error 502 при установке Discord на компьютер

  5. Вы получите уведомление о том, что ваш отчет успешно отправлен, после чего можно закрыть всплывающее окно.
  6. Уведомление об отправке сообщения об ошибке для решения ошибки Error 502 при установке Discord на компьютер

  7. После этого ознакомьтесь с тем, отправляет ли кто-то тоже репорты о проблеме в работе мессенджера. Если сейчас их много, значит, вы не единственный столкнувшийся с трудностями — стоит дождаться, пока они будут исправлены разработчиками.
  8. Проверка последних отчетов об ошибках для решения ошибки Error 502 при установке Discord на компьютер

  9. Ниже можете узнать, с чем именно возникают трудности у большинства пользователей, оставивших сообщение на сайте.
  10. Проверка типов ошибок для решения ошибки Error 502 при установке Discord на компьютер

Способ 2: Отключение брандмауэра Windows

Обычно Брандмауэр Защитника Windows не оказывает негативного влияния на установку Discord, но ситуация меняется, если изменения для этого компонента были внесены вручную или системным администратором. Даже если вы уверены, что ничего не меняли, все равно советуем на время отключить межсетевой экран и повторно запустить установку, проверяя, пропадет ли ошибка 502.

Подробнее: Отключаем брандмауэр в Windows 10

Отключение брандмауэра для решения ошибки Error 502 при установке Discord на компьютер

Способ 3: Сброс кеша DNS

Иногда рассматриваемая ошибка связана с проблемами индексации доменных адресов, что происходит при использовании DNS на компьютере. В его кеше хранятся разные адреса, из-за чего определение некоторых становится проблемой. Это может вызвать появление неполадок с установкой программы, поскольку переход на ее сервер просто не осуществляется.

  1. Откройте «Пуск», отыщите там приложение «Командная строка» и запустите его.
  2. Запуск Командной строки для решения ошибки Error 502 при установке Discord на компьютер

  3. Введите команду ipconfig /flushdns и активируйте ее нажатием Enter.
  4. Ввод команды для сброса кеша для решения ошибки Error 502 при установке Discord на компьютер

  5. Дождитесь появления информации о том, что кеш сопоставителя DNS успешно очищен, после чего закройте консоль, перезагрузите компьютер и повторите установку Discord.
  6. Успешное применение команды сброса кеша для решения ошибки Error 502 при установке Discord на компьютер

Вариант 6: Ошибка «A JavaScript error occurred in the main process»

Данная проблема встречается крайне редко, и известно только два метода, которые действительно помогут исправить ее. Первый заключается в удалении остаточных файлов предыдущей версии Discord, а второй — в очистке ПК от мусорных файлов, которые и мешают запуску процесса JavaScript.

Способ 1: Очистка остаточных файлов Discord

При штатном удалении мессенджера не все файлы очищаются автоматически — в пользовательских папках остаются другие директории и элементы. Их придется найти и удалить самостоятельно, осуществив следующую инструкцию.

  1. Откройте утилиту «Выполнить», используя для этого комбинацию клавиш Win + R. Введите там %localappdata% и нажмите Enter для применения команды.
  2. Переход к папке с остаточными файлами для решения ошибки A JavaScript error occurred in the main process при установке Discord на компьютер

  3. Найдите в появившемся окне папку «Discord» и щелкните по ней правой кнопкой мыши.
  4. Поиск первой папки с остаточными файлами для решения ошибки A JavaScript error occurred in the main process при установке Discord на компьютер

  5. Из появившегося контекстного меню выберите пункт «Удалить».
  6. Удаление первой папки с остаточными файлами для решения ошибки A JavaScript error occurred in the main process при установке Discord на компьютер

  7. Снова запустите «Выполнить», но в этот раз перейдите по адресу %appdata%.
  8. Переход ко второй папке с остальными файлами для решения ошибки A JavaScript error occurred in the main process при установке Discord на компьютер

  9. Отыщите там каталог с таким же названием и тоже удалите его.
  10. Удаление второй папки с остаточными файлами для решения ошибки A JavaScript error occurred in the main process при установке Discord на компьютер

Осталось только перезагрузить компьютер, чтобы все изменения вступили в силу и вы могли повторно запустить установку мессенджера, проверяя, пропала ли рассматриваемая ошибка.

Способ 2: Очистка ПК от мусора

Эффективность этого метода крайне спорная, но все-таки он помогает некоторым пользователям, столкнувшимся с ошибкой «A JavaScript error occurred in the main process». Вы можете использовать совершенно любой софт для очистки мусора, но мы рекомендуем присмотреться к бесплатной версии CCleaner, речь о которой идет в другой статье на нашем сайте.

Подробнее: Как очистить компьютер от мусора с помощью программы CCleaner

Очистка ПК от мусора для решения ошибки A JavaScript error occurred in the main process при установке Discord на компьютер

Конечно, ничего не мешает выбрать другую программу, если предложенная по каким-то причинам не подходит. Ознакомьтесь со списком доступных и самых популярных в полноформатном обзоре, кликнув по следующему заголовку.

Подробнее: Программы для очистки ПК от мусора

Summary

On closing the connection to Discord, it sometimes throws a RuntimeError: Event loop is closed. From what I’ve seen, this happens about 90% of the time. I’ve tested it using CTRL+C to shut the bot down, but not with a shutdown command. (EDIT: A friend gets this same issue using the logout() method as explained in a below comment).

Reproduction Steps

It’s happened in a few different scenarios, but this is enough to set it off from what I’ve seen.

async def shutdown(self):
        print(" Closing connection to Discord...")
        await super().close()

async def close(self):
        print("Closing on keyboard interrupt...")
        await self.shutdown()

Expected Results

The bot closes it’s connection to Discord. This does sometimes happen perfectly fine.

Actual Results

This error:

Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x0000014D19B61280>
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000014D18E1FC10>
Traceback (most recent call last):
  File "C:\Program Files\Python38\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Program Files\Python38\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Program Files\Python38\lib\asyncio\base_events.py", line 719, in call_soon
    self._check_closed()
  File "C:\Program Files\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

The program does always exit, but I feel like this error isn’t supposed to happen, especially as it doesn’t occur in versions 1.3.4 and below.

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

System Information

  • Python v3.8.5-final
  • discord.py v1.4.0-final
  • aiohttp v3.6.2
  • system info: Windows 10 10.0.19041


Go to discordapp


r/discordapp

Imagine a Place… where you can belong to a school club, a gaming group, or a worldwide art community. Where just you and handful of friends can spend time together. A place that makes it easy to talk every day and hang out more often.




Members





Online



Discord Setup Runtime Error

I had discord working and then it stopped after some use. I can’t delete the %appdata% completely and the setup doesn’t start. Says can’t find ‘discord_toaster’ when trying to boot discord. Setup causes a runtime error. Any help?

Archived post. New comments cannot be posted and votes cannot be cast.

Update Discord or delete the app cache to solve this problem

by Loredana Harsana

Loredana is a passionate writer with a keen interest in PC software and technology. She started off writing about mobile phones back when Samsung Galaxy S II was… read more


Updated on

  • Most complaints of encountering the error came from users who just updated their Discord apps.
  • Corrupt application data can also trigger the Well, this is awkward error on Discord.
  • Reinstalling the app is one of the most efficient ways to resolve the error.

Discord Well This Is Awkward

XINSTALL BY CLICKING THE DOWNLOAD FILE

To fix Windows PC system issues, you will need a dedicated tool

SPONSORED

Fortect is a tool that does not simply clean up your PC, but has a repository with several millions of Windows System files stored in their initial version. When your PC encounters a problem, Fortect will fix it for you, by replacing bad files with fresh versions. To fix your current PC issue, here are the steps you need to take:

  1. Download Fortect and install it on your PC.
  2. Start the tool’s scanning process to look for corrupt files that are the source of your problem
  3. Right-click on Start Repair so the tool could start the fixing algorythm
  • Fortect has been downloaded by 0 readers this month, rated 4.4 on TrustPilot

While attempting to launch Discord, our readers reported seeing a message which reads Well, this is awkward. The error often appears after an application update and prevents you from accessing Discord.

If you’re experiencing this issue, this guide will provide you with four ways to fix the Well, this is awkward error on Discord.

In this article

  • What causes the Discord Well, this is awkward crashes?
  • How can I fix Well, this is awkward on Discord?
  • 1. Delete Discord’s cache data
  • 2. Temporarily disable the antivirus
  • 3. Reinstall Discord

What causes the Discord Well, this is awkward crashes?

The error is usually caused by the following factors:

  • Application update – Most readers reported that they experienced the error after updating the Discord app. This could be due to glitches in the new updates.
  • Antivirus restrictions – If your antivirus software classifies Discord as harmful software, it can prevent it from functioning leading to the Well, this is awkward error on Discord.
  • Corrupt app data – Corrupt app data stored on your PC can trigger this error and many more, such as unexpected crashes on Discord.

Irrespective of the causes, explore the various ways to troubleshoot the error below.

How can I fix Well, this is awkward on Discord?

Before we proceed with more advanced solutions, here are quick fixes that can help resolve the error:

  • Restart the Discord app.
  • Restart your PC.
  • Check your PC’s internet speed. A connection issue may very well cause this issue.

If you still see the message when you open Discord, follow the steps listed below to fix the error.

1. Delete Discord’s cache data

  1. Press the Windows key + R to open the Run box, type %appdata%, and hit Enter.
  2. Locate the Discord folder in the Roaming folder, right-click, and select Delete.
  3. Once the folder is deleted, close the window, and restart your PC to complete the fix.

Over time, apps tend to accumulate data that can get corrupted by viruses or malware. Clearing the Discord cache is one way to fix the error. Further, you can also check out our guide on fixing corrupt system files on Windows.

2. Temporarily disable the antivirus

  1. Press Windows, search Windows Security, and launch it.
  2. Click on Virus and Threat Protection, and click Manage Settings under the Virus & Threat Protection settings.
  3. In the next window, click the toggle button next to Real-Time Protection to turn off the feature. (You can also disable more options in this tab).
  4. Close the Windows Security window and restart your PC to check if the error is resolved.

Antivirus software protects your PC from threats and harmful files, but it can sometimes interfere with the operations of other applications.

If you are using a third-party antivirus, make sure you disable it temporarily and see if you can open Discord without issues.

In case you discover that the antivirus is the culprit, try to include Discord in its exception list or get a better antivirus that won’t interfere with your legitimate software.

Read more about this topic

  • Fix: MSI Afterburner Failed to Start Scanning
  • How to Fix Microsoft Common Language Runtime Native Compiler High CPU Usage?

3. Reinstall Discord

  1. Press the Windows key, type control panel, and hit Enter.
  2. Click on Programs and Features in the Control Panel window.
  3. Scroll down to locate Discord, click on it, and click Uninstall.
  4. If there is a confirmation prompt, click Yes to confirm the uninstallation.
  5. Close the Control Panel once the process is completed.
  6. Press the Windows key, type Microsoft Store, and hit Enter.
  7. Type Discord, and click on the displayed result.
  8. Click the Get or Install button to download the app.
  9. Once it’s installed, launch the app to see if the error is fixed.

Reinstalling Discord is one of the most effective ways to resolve errors with the app, as it eliminates corrupt files and configurations that could’ve triggered the error.

Fixing Discord errors is usually straightforward and involves a similar process. With the steps outlined above, you should be able to fix the Well, this is awkward error.

You may also be interested in our guide on what to do if Discord is not opening at all.

Should you have further questions or suggestions, kindly drop them in the comments section.

newsletter icon

After successfully installing the latest version (1.6.0) of
discord.py
, I attempted to run a simple code that involved running the bot. Unfortunately, instead of the expected output, I was met with an extensive list of errors. The code in question is provided below:

import discord
client = discord.Client()
client.run("***")

The errors:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/connector.py", line 969, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # noqa
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 1081, in create_connection
    transport, protocol = await self._create_connection_transport(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 1111, in _create_connection_transport
    await waiter
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/sslproto.py", line 528, in data_received
    ssldata, appdata = self._sslpipe.feed_ssldata(data)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/sslproto.py", line 188, in feed_ssldata
    self._sslobj.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 944, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/Users/yasharnishaburi/Desktop/PokeBot/BaiduBot2.py", line 4, in 
    client.run("***")
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/client.py", line 718, in run
    return future.result()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/client.py", line 697, in runner
    await self.start(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/client.py", line 660, in start
    await self.login(*args, bot=bot)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/client.py", line 509, in login
    await self.http.static_login(token.strip(), bot=bot)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/http.py", line 293, in static_login
    data = await self.request(Route('GET', '/users/@me'))
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discord/http.py", line 185, in request
    async with self.__session.request(method, url, **kwargs) as r:
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/client.py", line 1117, in __aenter__
    self._resp = await self._coro
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/client.py", line 520, in _request
    conn = await self._connector.connect(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/connector.py", line 535, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/connector.py", line 892, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/connector.py", line 1051, in _create_direct_connection
    raise last_exc
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/connector.py", line 1020, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aiohttp/connector.py", line 971, in _wrap_create_connection
    raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discord.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')]

For obvious reasons, I have substituted the token in the code and the error with asterisks.

Понравилась статья? Поделить с друзьями:
  • Ошибка диска при запуске виндовс
  • Ошибка двигателя p1614 nissan
  • Ошибка двигателя 141
  • Ошибка двигателя джили эмгранд х7
  • Ошибка двигателя 0301