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

Responding to slash command in socket mode using node v20 causes exception #1917

Closed
filmaj opened this issue Aug 2, 2023 · 3 comments
Closed
Labels
auto-triage-stale bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented

Comments

@filmaj
Copy link
Contributor

filmaj commented Aug 2, 2023

When running an app in socket mode, have the app create a modal with an e.g. plain text input with an action_id using a slash command. For example, register a slash command that opens a modal:

app.command('/post', async ({ ack, body, client, logger }) => {
  console.log('post coming in');
  // Acknowledge the command request
  await ack();
});

Then trigger the slash command (/post in the above example), you will see output like:

[DEBUG]  bolt-app initialized
post coming in
[DEBUG]  socket-mode:SocketModeClient:0 Calling ack() - type: slash_commands, envelope_id: 44639bd2-7246-47cc-a587-80b6c3276cde, data: undefined
[DEBUG]  socket-mode:SocketModeClient:0 send() method was called in state: connected, state hierarchy: connected,ready
[DEBUG]  socket-mode:SocketModeClient:0 Sending a WebSocket message: {"envelope_id":"44639bd2-7246-47cc-a587-80b6c3276cde","payload":{}}
/Users/fmaj/src/slapp-BoltJSApp/node_modules/@slack/socket-mode/dist/SocketModeClient.js:320
                        this.logger.error(`Failed to send a WebSocket message (error: ${error.message})`);
                                                                                              ^

TypeError: Cannot read properties of null (reading 'message')
    at Object.callback (/Users/fmaj/src/slapp-BoltJSApp/node_modules/@slack/socket-mode/dist/SocketModeClient.js:320:95)
    at callback (node:internal/streams/writable:562:21)
    at afterWrite (node:internal/streams/writable:507:5)
    at onwrite (node:internal/streams/writable:487:7)
    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:106:10)

Node.js v20.5.0

This does not happen in node v18.

Reproducible in:

The Slack SDK version

3.12.3

Node.js runtime version

v20.5.0

@filmaj filmaj added the bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented label Aug 2, 2023
@filmaj
Copy link
Contributor Author

filmaj commented Aug 2, 2023

I noticed this commit in the node-slack-sdk: slackapi/node-slack-sdk@1c72709

I think the same fix needs to be applied in all of our libraries.

@github-actions
Copy link

github-actions bot commented Sep 4, 2023

👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.

@github-actions
Copy link

As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-triage-stale bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented
Projects
None yet
Development

No branches or pull requests

1 participant