How do I fix this issue here? [closed] - javascript

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 days ago.
Improve this question
TypeError: Cannot read properties of undefined (reading 'id')
at Client.<anonymous> (C:\Users\jean-\OneDrive\Desktop\twitch-follow-discord-bot-main\index.js:148:105)
at Client.emit (node:events:513:28)
at MessageCreateAction.handle (C:\Users\jean-\OneDrive\Desktop\twitch-follow-discord-bot-main\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at module.exports [as MESSAGE_CREATE] (C:\Users\jean-\OneDrive\Desktop\twitch-follow-discord-bot-main\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\jean-\OneDrive\Desktop\twitch-follow-discord-bot-main\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\jean-\OneDrive\Desktop\twitch-follow-discord-bot-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\jean-\OneDrive\Desktop\twitch-follow-discord-bot-main\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\jean-\OneDrive\Desktop\twitch-follow-discord-bot-main\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (node:events:513:28)
at Receiver.receiverOnMessage (C:\Users\jean-\OneDrive\Desktop\twitch-follow-discord-bot-main\node_modules\ws\lib\websocket.js:1068:20)
I have researched the web to find a fix and nothing has been found.

Related

TypeError: Cannot read property 'id' of undefined at ClientDataManager.newChannel ClientDataManager.js:81:36

my node.js discord bot (discord.js based) suddenly shut down an hour ago and now produces an error on startup.
Bot started!
Found 3 commands, loading.
/var/www/bot/live/node_modules/discord.js/src/client/ClientDataManager.js:81
guild.channels.set(channel.id, channel);
^
TypeError: Cannot read property 'id' of undefined
at ClientDataManager.newChannel (/var/www/bot/live/node_modules/discord.js/src/client/ClientDataManager.js:81:36)
at Guild.setup (/var/www/bot/live/node_modules/discord.js/src/structures/Guild.js:307:68)
at GuildCreateHandler.handle (/var/www/bot/live/node_modules/discord.js/src/client/websocket/packets/handlers/GuildCreate.js:12:15)
at WebSocketPacketManager.handle (/var/www/bot/live/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:108:65)
at WebSocketConnection.onPacket (/var/www/bot/live/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:336:35)
at WebSocketConnection.onMessage (/var/www/bot/live/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:299:17)
at WebSocket.onMessage (/var/www/bot/live/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (/var/www/bot/live/node_modules/ws/lib/websocket.js:789:20)
at Receiver.emit (events.js:315:20)
This is all I see. The script does the whole loading method and then just crashes.
And I'm not even using any channel info.
Any idea what this could be?
There have not been any updates. The server and bot wasn't touched for a month and worked flawless.
I have experienced the same problem.
It seems that the issue is caused by the new "Stage channels" feature because deleting it on my serer solved the problem for me and my bot started fine. But I am a newbie so I am not sure if it's possible to fix it within the code.

Karma in IntelliJ: Test framework quit unexpectedly [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
Searched for this error and nothing useful, so posting here.
I have a unit test for my Angular app and when I run it or debug it, it completes successfully. When I run code coverage, I get
13 11 2019 13:01:48.249:ERROR [karma-server]: TypeError: Cannot read property 'indexOf' of undefined
at Object.exports.arrayRemove (C:\casenet\sources\provider-portal\portal-client\node_modules\karma\lib\helper.js:109:26)
at _reporters.forEach (C:\casenet\sources\provider-portal\portal-client\node_modules\karma\lib\reporters\multi.js:15:50)
at Array.forEach (<anonymous>)
at MultiReporter.removeAdapter (C:\casenet\sources\provider-portal\portal-client\node_modules\karma\lib\reporters\multi.js:15:21)
at C:\Users\thehl\.IntelliJIdea2019.2\config\plugins\js-karma\js_reporter\karma-intellij\lib\intellijReporter.js:83:25
at Array.forEach (<anonymous>)
at C:\Users\thehl\.IntelliJIdea2019.2\config\plugins\js-karma\js_reporter\karma-intellij\lib\intellijReporter.js:81:33
at process._tickCallback (internal/process/next_tick.js:61:11)
13 11 2019 13:01:48.626:ERROR [karma-server]: TypeError: Cannot read property 'push' of undefined
at _reporters.forEach (C:\casenet\sources\provider-portal\portal-client\node_modules\karma\lib\reporters\multi.js:11:61)
at Array.forEach (<anonymous>)
at MultiReporter.addAdapter (C:\casenet\sources\provider-portal\portal-client\node_modules\karma\lib\reporters\multi.js:11:21)
at Server.<anonymous> (C:\casenet\sources\provider-portal\portal-client\node_modules\karma\lib\middleware\runner.js:41:18)
at Object.onceWrapper (events.js:277:13)
at Server.emit (events.js:194:15)
at Executor.schedule (C:\casenet\sources\provider-portal\portal-client\node_modules\karma\lib\executor.js:30:20)
at C:\casenet\sources\provider-portal\portal-client\node_modules\karma\lib\middleware\runner.js:92:22
at tryCatcher (C:\casenet\sources\provider-portal\portal-client\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\casenet\sources\provider-portal\portal-client\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (C:\casenet\sources\provider-portal\portal-client\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (C:\casenet\sources\provider-portal\portal-client\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (C:\casenet\sources\provider-portal\portal-client\node_modules\bluebird\js\release\promise.js:729:18)
at Promise._fulfill (C:\casenet\sources\provider-portal\portal-client\node_modules\bluebird\js\release\promise.js:673:18)
at Promise._resolveCallback (C:\casenet\sources\provider-portal\portal-client\node_modules\bluebird\js\release\promise.js:466:57)
at Promise._settlePromiseFromHandler (C:\casenet\sources\provider-portal\portal-client\node_modules\bluebird\js\release\promise.js:559:17)
Cannot read property 'success' of undefined
TypeError: Cannot read property 'success' of undefined
at TestCommand.runSingleTarget (C:\casenet\sources\provider-portal\portal-client\node_modules\#angular\cli\models\packages\angular\cli\models\architect-command.ts:242:21)
In addition, I get this in the Test Run window:
"C:\Program Files\nodejs\node.exe" C:\Users\thehl\.IntelliJIdea2019.2\config\plugins\js-karma\js_reporter\karma-intellij\lib\intellijRunner.js --serverPort=9876 --protocol=http: --urlRoot=/ "--testName=^COMPONENT/CLIENT -> DynamicInputComponent "
C:\Users\thehl\.IntelliJIdea2019.2\config\plugins\js-karma\js_reporter\karma-intellij\lib\intellijRunner.js:60
throw e;
^
Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:111:27)
I tried a full reboot and upgrading everything that said karma to the current version.
Have no idea where to even start debugging this.
Problem was caused by a recent change using karma-parallel. We broke up our unit tests to run in 4 separate threads with 4 separate web browsers.
I pulled all the references and definitions for karma-parallel from the package.json and from karma.conf.js. Unit tests work fine now within IntelliJ.
I'm simply going to have to roll this back every time I want to do this from now on.

Cannot get YTDL-core to work with discord.js

Code at: https://github.com/Zentrik/DiscordBot/blob/master/Bot.js
I either get the error:
server.queue.push(args[1]);
^
TypeError: Cannot read property 'queue' of undefined
at Client.<anonymous> (/home/ubuntu/discordbot/bot.js:133:19)
at emitOne (events.js:115:13)
at Client.emit (events.js:210:7)
at MessageCreateHandler.handle (/home/ubuntu/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/home/ubuntu/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (/home/ubuntu/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:330:35)
at WebSocketConnection.onMessage (/home/ubuntu/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:293:17)
at WebSocket.onMessage (/home/ubuntu/node_modules/ws/lib/EventTarget.js:99:16)
at emitOne (events.js:115:13)
at WebSocket.emit (events.js:210:7)
Or:
(node:8565) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'push' of undefined
(node:8565) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I got this code from here: https://www.youtube.com/watch?v=z4S2qqX7YvA
I'm pretty sure the code is the same.
The bot joins the voice channel and has permissions to join and speak.
I'm new to javascript so I don' get what's going wrong any help would be appreciated
EDIT: There was a spelling mistake, I fixed it but now audio finishes right after starting, no sound is produced.
servers[message.guild.id] is [object Object]
server.queue[0] is the same url but later adds 'undefined' to the end of the url.
server.dispatcher is also [object Object]
It is not a problem with the code, as it can works on other machines, thanks for your help. FFMPEG does not work on updated debian systems instead do sudo apt-get install libav-tools -y

AngularJS + Webpack Mysterious Bug - Cannot read property 'call' of undefined

I'm working on a project using AngularJS with Webpack, I'm getting a very weird bug:
Sometimes an error will show up:
TypeError: Cannot read property 'call' of undefined
at __webpack_require__ (vendor.js:51)
at Object.357 (templates.js:377)
at __webpack_require__ (vendor.js:51)
at exam (app.js:17755)
at Object.invoke (vendor.js:21978)
at vendor.js:24895
at forEach (vendor.js:17592)
at Object.<anonymous> (vendor.js:24893)
at Object.invoke (vendor.js:21978)
at Object.enforcedReturnValue [as $get] (vendor.js:21817)(anonymous function) # vendor.js:30912
The weird part: When i comment out the recently changed piece of code, and re-insert it (such that the code is the same), it suddenly works for a little while, then the same error appears !
I don't have the slightest clue as to what's causing this, Any help will be greatly appreciated.

Finding the source of a CERT_UNTRUSTED error in node on heroku

We run a node app on heroku. The app makes outgoing https connections to many services, but we can't reproduce our problem with any of these services. We are occasionally (6 times in the last 30 minutes) seeing this error appear and having a hard time tracking it down:
Error: CERT_UNTRUSTED
at SecurePair.<anonymous> (tls.js:1381:32)
at SecurePair.emit (events.js:92:17)
at SecurePair.maybeInitFinished (tls.js:980:10)
at CleartextStream.read [as _read] (tls.js:472:13)
at CleartextStream.Readable.read (_stream_readable.js:341:10)
at EncryptedStream.write [as _write] (tls.js:369:25)
at doWrite (_stream_writable.js:226:10)
at writeOrBuffer (_stream_writable.js:216:5)
at EncryptedStream.Writable.write (_stream_writable.js:183:11)
at write (_stream_readable.js:602:24)
at flow (_stream_readable.js:611:7)
at Socket.pipeOnReadable (_stream_readable.js:643:5)
at Socket.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:427:10)
at emitReadable (_stream_readable.js:423:5)
at readableAddChunk (_stream_readable.js:166:9)
at Socket.Readable.push (_stream_readable.js:128:10)
at TCP.onread (net.js:529:21)
at TCP.onread (/app/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:177:31)
The only hint about files is the newrelic module at the bottom, which I assume would be in any stacktrace. Does anyone have advice for figuring out where this error is coming from?
If you are using node 0.10.34, this could be the issue
https://github.com/joyent/node/issues/8894
Recommend using v0.10.33 for now.

Categories