You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeError: Cannot read properties of undefined (reading 'type') at SocketModeClient.onWebSocketMessage #2167
TypeError: Cannot read properties of undefined (reading 'type')
at SocketModeClient.onWebSocketMessage (/app/node_modules/@slack/socket-mode/dist/SocketModeClient.js:620:43)
at WebSocket.onMessage (/app/node_modules/ws/lib/event-target.js:132:16)
at WebSocket.emit (node:events:514:28)
at Receiver.receiverOnMessage (/app/node_modules/ws/lib/websocket.js:1070:20)
at Receiver.emit (node:events:514:28)
at Receiver.dataMessage (/app/node_modules/ws/lib/receiver.js:517:14)
at Receiver.getData (/app/node_modules/ws/lib/receiver.js:435:17)
at Receiver.startLoop (/app/node_modules/ws/lib/receiver.js:143:22)
at Receiver._write (/app/node_modules/ws/lib/receiver.js:78:10)
at writeOrBuffer (node:internal/streams/writable:447:12)
at _write (node:internal/streams/writable:389:10)
at Receiver.Writable.write (node:internal/streams/writable:393:10)
at TLSSocket.socketOnData (/app/node_modules/ws/lib/websocket.js:1164:35)
at TLSSocket.emit (node:events:514:28)
Packages:
Select all that apply:
@slack/web-api
@slack/rtm-api
@slack/webhooks
@slack/oauth
@slack/socket-mode
@slack/types
I don't know
Reproducible in:
The Slack SDK version
"@slack/socket-mode": "1.3.6"
Node.js runtime version
v20.9.0
OS info
#141~20.04.1-Ubuntu SMP Thu Jan 16 18:38:51 UTC 2025
Steps to reproduce:
N/A
Expected result:
Missing payload handled gracefully
Actual result:
Unhandled error
Requirements
For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇
HI @levenleven! Thanks for bringing this to our attention. Unfortunately, we'll need more information in order to begin to debug and remedy what is going on here. If you're able to provide which event(s) that this error is occurring for, that'd be a great start.
Are message events the only events that your app listens for/subscribes to then? On your end and with your own logs, are you able to narrow down which specific message event type is causing the issue?
Hey @zimeg, looks like the same error after upgrade to "@slack/socket-mode": "2.0.4"
TypeError: Cannot read properties of undefined (reading 'type')
at SocketModeClient.<anonymous> (/app/node_modules/@slack/socket-mode/dist/src/SocketModeClient.js:302:47)
at Generator.next (<anonymous>:null:null)
at /app/node_modules/@slack/socket-mode/dist/src/SocketModeClient.js:41:71
at new Promise (<anonymous>:null:null)
at __awaiter (/app/node_modules/@slack/socket-mode/dist/src/SocketModeClient.js:37:12)
at SocketModeClient.onWebSocketMessage (/app/node_modules/@slack/socket-mode/dist/src/SocketModeClient.js:263:16)
at SocketModeClient.emit (/app/node_modules/eventemitter3/index.js:182:35)
at WebSocket.<anonymous> (/app/node_modules/@slack/socket-mode/dist/src/SlackWebSocket.js:87:33)
at WebSocket.emit (node:events:524:28)
at Receiver.receiverOnMessage (/app/node_modules/ws/lib/websocket.js:1220:20)
at Receiver.emit (node:events:524:28)
at Receiver.dataMessage (/app/node_modules/ws/lib/receiver.js:596:14)
at Receiver.getData (/app/node_modules/ws/lib/receiver.js:496:10)
at Receiver.startLoop (/app/node_modules/ws/lib/receiver.js:167:16)
at Receiver._write (/app/node_modules/ws/lib/receiver.js:94:10)
at writeOrBuffer (node:internal/streams/writable:572:12)
at _write (node:internal/streams/writable:501:10)
at Receiver.Writable.write (node:internal/streams/writable:510:10)
at TLSSocket.socketOnData (/app/node_modules/ws/lib/websocket.js:1355:35)
at TLSSocket.emit (node:events:524:28)
at addChunk (node:internal/streams/readable:561:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
at TLSSocket.Readable.push (node:internal/streams/readable:392:5)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:191:23)
at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17)
👋 Thanks @levenleven for sticking with this one, and @radiantspace for capturing the payload! It was the app_rate_limited event, which arrives without an inner event. #2754 fixes the crash and will be out in the next @slack/socket-mode release, so I'm going to close this issue.
Activity
misscoded commentedon Mar 6, 2025
HI @levenleven! Thanks for bringing this to our attention. Unfortunately, we'll need more information in order to begin to debug and remedy what is going on here. If you're able to provide which event(s) that this error is occurring for, that'd be a great start.
levenleven commentedon Mar 7, 2025
@misscoded thanks for looking into this. We subscribe to message events using bolt sdk (e.g.
app.message(...)).misscoded commentedon Mar 7, 2025
Are message events the only events that your app listens for/subscribes to then? On your end and with your own logs, are you able to narrow down which specific message event type is causing the issue?
levenleven commentedon Mar 9, 2025
Sorry, missed we also have
app.actionsubscription. So only these two, message and action.This is not reproducible (at least now), we've got ~ 20 such errors between Mar 5, 2025 10:40:00 PM UTC and Mar 6, 2025 10:51:30 PM UTC
No, as this is happening not in application but in framework code.
misscoded commentedon Mar 13, 2025
No worries! If you provide us your app ID, we might be able to look into the logs and figure out what the event in question is.
levenleven commentedon Mar 17, 2025
Thanks! App id is
A02V1ADGH5Flevenleven commentedon Mar 18, 2025
Few other occasions
levenleven commentedon Apr 3, 2025
@misscoded Is there anything else I can do to help with the investigation?
github-actions commentedon May 5, 2025
levenleven commentedon May 5, 2025
Last seen on Apr 16, so maybe fixed on server side, or we just didn't receive some specific event type that causes this.
5 remaining items
levenleven commentedon Jul 28, 2025
keep
zimeg commentedon Jul 29, 2025
Hey @levenleven! 👋 I'm catching up on this thread now and noticed
@slack/socket-moode@1.3.6is used when this error is found.The latest release right now is
@slack/socket-mode@2.0.4and I'm wondering if updating to this version resolves this? 🤖levenleven commentedon Aug 5, 2025
Hey @zimeg, looks like the same error after upgrade to
"@slack/socket-mode": "2.0.4"node-slack-sdk/packages/socket-mode/src/SocketModeClient.ts
Lines 344 to 345 in 0ddbaf7
So
event.payload.eventhere isundefined.radiantspace commentedon Oct 20, 2026
We managed to grab the payload for this error. It's rate limiting event, that SDK doesn't handle:
radiantspace commentedon Oct 20, 2026
@misscoded @zimeg hey, hope the payload helps to fix the problem ^. That is still reproducible in v3.1.0.
mwbrooks commentedon Oct 28, 2026
👋 Thanks @levenleven for sticking with this one, and @radiantspace for capturing the payload! It was the
app_rate_limitedevent, which arrives without an innerevent. #2754 fixes the crash and will be out in the next@slack/socket-moderelease, so I'm going to close this issue.