Bolt-js: TypeError: respond is not a function

Created on 22 Nov 2019  路  4Comments  路  Source: slackapi/bolt-js

Description

Describe your issue here.

What type of issue is this? (place an x in one of the [ ])

  • [X] bug
  • [ ] enhancement (feature request)
  • [ ] question
  • [ ] documentation related
  • [ ] testing related
  • [ ] discussion

Requirements (place an x in each of the [ ])

  • [X] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [X] I've read and agree to the Code of Conduct.
  • [X] I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

package version: 1.4.1

node version: 10 or above

OS version(s): ubuntu

Steps to reproduce:

  1. setup action ID
  2. listen to action ID
  3. see the error

Expected result:

What you expected to happen
respond message to slack messenger

Actual result:

What actually happened
TypeError: respond is not a function

Attachments:

app.action('action-code', async ({ action, ack, respond, body, context }) => {
    ack();

    respond(`action received`);
    console.log('passing data to function');    
});
(node:4492) UnhandledPromiseRejectionWarning: TypeError: respond is not a function
    at app.action (/home/ubuntu/youSlack_v2/index.js:279:2)
    at next (/home/ubuntu/youSlack_v2/node_modules/@slack/bolt/dist/middleware/process.js:18:13)
    at /home/ubuntu/youSlack_v2/node_modules/@slack/bolt/dist/middleware/builtin.js:141:9
    at next (/home/ubuntu/youSlack_v2/node_modules/@slack/bolt/dist/middleware/process.js:18:13)
    at exports.onlyActions (/home/ubuntu/youSlack_v2/node_modules/@slack/bolt/dist/middleware/builtin.js:13:5)
    at Object.processMiddleware (/home/ubuntu/youSlack_v2/node_modules/@slack/bolt/dist/middleware/process.js:51:5)
    at listeners.forEach (/home/ubuntu/youSlack_v2/node_modules/@slack/bolt/dist/App.js:245:27)
    at Array.forEach (<anonymous>)
    at process_1.processMiddleware (/home/ubuntu/youSlack_v2/node_modules/@slack/bolt/dist/App.js:243:28)
    at next (/home/ubuntu/youSlack_v2/node_modules/@slack/bolt/dist/middleware/process.js:42:13)
    at process._tickCallback (internal/process/next_tick.js:61:11)
(node:4492) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:4492) [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.
question

Most helpful comment

I'm glad it helped you! Allow me to close this issue now.

All 4 comments

@johnsonyick Hello, I guess this block_actions request is coming from a view (=modal or App Home). Am I right? If so, the payload in the case doesn't have a response_url so that respond function is unavailable.

@seratch Thanks so much for your clear eye, I have figured out how to identify it, you saved my days!

I'm glad it helped you! Allow me to close this issue now.

I'm struggling with this same issue.

How can I respond to an ephemeral message after closing a modal?

the flow is post eph message with button -> open modal -> update eph message on modul submit.

Was this page helpful?
0 / 5 - 0 ratings