Skip to content

TypeError: Cannot read properties of undefined (reading 'cache') #647

@DarthGandalf

Description

@DarthGandalf

Today the bridge was crashlooping for a while, with this in logs:

> [email protected] start
> node dist/index.js --config /config/config.json

2026-01-01T15:21:13.499Z �[32minfo�[39m: Connected to Discord
2026-01-01T15:21:15.396Z �[32minfo�[39m: Connected to IRC
2026-01-04T06:00:34.319Z �[32minfo�[39m: Connected to IRC
2026-01-05T03:34:14.034Z �[32minfo�[39m: Connected to IRC
2026-01-14T00:11:00.433Z �[33mwarn�[39m: Received warn event from Discord Discord sent a typing packet to a voice channel 417172516356751360
/bot/node_modules/discord.js/src/client/actions/MessageCreate.js:11
      const existing = channel.messages.cache.get(data.id);
                                        ^

TypeError: Cannot read properties of undefined (reading 'cache')
    at MessageCreateAction.handle (/bot/node_modules/discord.js/src/client/actions/MessageCreate.js:11:41)
    at module.exports [as MESSAGE_CREATE] (/bot/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/bot/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (node:events:514:28)
    at Receiver.receiverOnMessage (/bot/node_modules/ws/lib/websocket.js:834:20)
    at Receiver.emit (node:events:514:28)
    at Receiver.dataMessage (/bot/node_modules/ws/lib/receiver.js:437:14)

Node.js v20.7.0
npm notice 
npm notice New major version of npm available! 10.1.0 -> 11.7.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v11.7.0>
npm notice Run `npm install -g [email protected]` to update!
npm notice 

> [email protected] start
> node dist/index.js --config /config/config.json

2026-01-14T00:11:05.504Z �[32minfo�[39m: Connected to Discord
2026-01-14T00:11:06.925Z �[31merror�[39m: Received error event from IRC {
  prefix: 'iridium.libera.chat',
  server: 'iridium.libera.chat',
  command: 'err_notregistered',
  rawCommand: '451',
  commandType: 'error',
  args: [ '*', 'You have not registered' ]
}
2026-01-14T00:11:07.929Z �[32minfo�[39m: Connected to IRC
2026-01-14T00:11:09.634Z �[33mwarn�[39m: Received warn event from Discord Discord sent a typing packet to a voice channel 417172516356751360
/bot/node_modules/discord.js/src/client/actions/MessageCreate.js:11
      const existing = channel.messages.cache.get(data.id);
                                        ^

TypeError: Cannot read properties of undefined (reading 'cache')
    at MessageCreateAction.handle (/bot/node_modules/discord.js/src/client/actions/MessageCreate.js:11:41)
    at module.exports [as MESSAGE_CREATE] (/bot/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/bot/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (node:events:514:28)
    at Receiver.receiverOnMessage (/bot/node_modules/ws/lib/websocket.js:834:20)
    at Receiver.emit (node:events:514:28)
    at Receiver.dataMessage (/bot/node_modules/ws/lib/receiver.js:437:14)

Node.js v20.7.0
npm notice 
npm notice New major version of npm available! 10.1.0 -> 11.7.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v11.7.0>
npm notice Run `npm install -g [email protected]` to update!
npm notice 

> [email protected] start
> node dist/index.js --config /config/config.json

2026-01-14T00:11:16.196Z �[32minfo�[39m: Connected to Discord
2026-01-14T00:11:18.314Z �[32minfo�[39m: Connected to IRC
2026-01-14T00:11:28.055Z �[33mwarn�[39m: Received warn event from Discord Discord sent a typing packet to a voice channel 417172516356751360
/bot/node_modules/discord.js/src/client/actions/MessageCreate.js:11
      const existing = channel.messages.cache.get(data.id);
                                        ^

TypeError: Cannot read properties of undefined (reading 'cache')
    at MessageCreateAction.handle (/bot/node_modules/discord.js/src/client/actions/MessageCreate.js:11:41)
    at module.exports [as MESSAGE_CREATE] (/bot/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/bot/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (node:events:514:28)
    at Receiver.receiverOnMessage (/bot/node_modules/ws/lib/websocket.js:834:20)
    at Receiver.emit (node:events:514:28)
    at Receiver.dataMessage (/bot/node_modules/ws/lib/receiver.js:437:14)

Node.js v20.7.0

> [email protected] start
> node dist/index.js --config /config/config.json

2026-01-14T00:11:30.640Z �[32minfo�[39m: Connected to Discord
2026-01-14T00:11:32.759Z �[32minfo�[39m: Connected to IRC
2026-01-14T00:11:36.747Z �[33mwarn�[39m: Received warn event from Discord Discord sent a typing packet to a voice channel 417172516356751360
/bot/node_modules/discord.js/src/client/actions/MessageCreate.js:11
      const existing = channel.messages.cache.get(data.id);
                                        ^

TypeError: Cannot read properties of undefined (reading 'cache')
    at MessageCreateAction.handle (/bot/node_modules/discord.js/src/client/actions/MessageCreate.js:11:41)
    at module.exports [as MESSAGE_CREATE] (/bot/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/bot/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (node:events:514:28)
    at Receiver.receiverOnMessage (/bot/node_modules/ws/lib/websocket.js:834:20)
    at Receiver.emit (node:events:514:28)
    at Receiver.dataMessage (/bot/node_modules/ws/lib/receiver.js:437:14)

Node.js v20.7.0

> [email protected] start
> node dist/index.js --config /config/config.json
................

Seems related to #620

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions