Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node Red crashing on startup #24

Open
Eeems opened this issue Apr 5, 2021 · 11 comments
Open

Node Red crashing on startup #24

Eeems opened this issue Apr 5, 2021 · 11 comments
Labels
breaking The breaking issue. Must be solved as soon as possible

Comments

@Eeems
Copy link

Eeems commented Apr 5, 2021

It looks like a discord API change has broken this project. To the point where it's crashing the node-red instance on startup.

TypeError: Cannot read property 'id' of undefined
    at ClientDataManager.newChannel (/data/node_modules/discord.js/src/client/ClientDataManager.js:81:36)
    at Guild.setup (/data/node_modules/discord.js/src/structures/Guild.js:307:68)
    at GuildCreateHandler.handle (/data/node_modules/discord.js/src/client/websocket/packets/handlers/GuildCreate.js:12:15)
    at WebSocketPacketManager.handle (/data/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:108:65)
    at WebSocketConnection.onPacket (/data/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:336:35)
    at WebSocketConnection.onMessage (/data/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:299:17)
    at WebSocket.onMessage (/data/node_modules/discord.js/node_modules/ws/lib/event-target.js:120:16)
    at WebSocket.emit (events.js:198:13)
    at Receiver.receiverOnMessage (/data/node_modules/discord.js/node_modules/ws/lib/websocket.js:789:20)
    at Receiver.emit (events.js:198:13)
    at Receiver.dataMessage (/data/node_modules/discord.js/node_modules/ws/lib/receiver.js:413:14)
    at Receiver.getData (/data/node_modules/discord.js/node_modules/ws/lib/receiver.js:352:17)
    at Receiver.startLoop (/data/node_modules/discord.js/node_modules/ws/lib/receiver.js:138:22)
    at Receiver._write (/data/node_modules/discord.js/node_modules/ws/lib/receiver.js:74:10)
    at doWrite (_stream_writable.js:415:12)
    at writeOrBuffer (_stream_writable.js:399:5)
    at Receiver.Writable.write (_stream_writable.js:299:11)
    at TLSSocket.socketOnData (/data/node_modules/discord.js/node_modules/ws/lib/websocket.js:864:35)
    at TLSSocket.emit (events.js:198:13)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:269:11)
    at TLSSocket.Readable.push (_stream_readable.js:224:10)
    at TLSWrap.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

This likely will be resolved by resolving #4

@RamikOaken
Copy link

Dealing with the same issue here.

@madmax3365
Copy link
Owner

madmax3365 commented Apr 12, 2021

Sorry for the late response guys, been too busy for days.

There's 90% working code on the V3 branch for sending and receiving messages.
I'll push production-ready code tomorrow for those two features.
So you can use the V3 branch until I'll finish the rest part of the code.

@madmax3365 madmax3365 added the breaking The breaking issue. Must be solved as soon as possible label Apr 12, 2021
@madmax3365
Copy link
Owner

madmax3365 commented Apr 19, 2021

@Eeems , @RamikOaken
Ok, so I've managed to push stable code to the V3 branch and add some documentation in wiki
You can install and use it with the following commands

git clone  [email protected]:madmax3365/node-red-node-discord.git
cd node-red-node-discord
git checkout v3
yarn && yarn build && yarn link

Currently, there are only send messages and get messages nodes.

@Eeems
Copy link
Author

Eeems commented Apr 19, 2021

Looks like you've removed monitor members from v3?
image

EDIT: It also looks like you've changed the data structure being passed around? It's currently missing author.tag and channel.name which I was using previously.

@madmax3365
Copy link
Owner

madmax3365 commented Apr 19, 2021

The monitor members node must be refactored. Will add it in the near future.
Yeap I've changed the data structure. In the future, If you'll need some fields that missing from there we can add them easily.
P.S. I've added user.tag and channel.name props with the latest commit.

@eiiot
Copy link

eiiot commented May 2, 2021

I'm also trying to fix this, but can't install this git clone [email protected]:madmax3365/node-red-node-discord.git as I don't have permissions.

What's the best way to install V3

@Eeems
Copy link
Author

Eeems commented May 2, 2021

@eiiot
Copy link

eiiot commented May 3, 2021

Thanks!

@eiiot
Copy link

eiiot commented May 5, 2021

Installed using the instructions above, now I can't install other nodes, getting the error "/home/pi/docker/node-red/node_modules/node-red-node-discord: Appears to be a git repo or submodule."

@Cronus89
Copy link

I'm having this issue and i use NodeRed in docker (via HomeAssistant) Is there a way to install the updated version in it?

@Eeems
Copy link
Author

Eeems commented Jun 29, 2021

Installed using the instructions above, now I can't install other nodes, getting the error "/home/pi/docker/node-red/node_modules/node-red-node-discord: Appears to be a git repo or submodule."

I'd recommend cloning the repo to a different folder and symlinking it into node_modules. When you need to install a new module, remove the symlink, run the install, and then symlink it again.

I'm having this issue and i use NodeRed in docker (via HomeAssistant) Is there a way to install the updated version in it?

I can't speak for home assistant, but you should still have access to the node_modules folder in the node-red docker. You may have to check what volumes are being used, and then make the changes to where the volume is stored on disk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking The breaking issue. Must be solved as soon as possible
Projects
None yet
Development

No branches or pull requests

5 participants