-
Notifications
You must be signed in to change notification settings - Fork 423
Description
(Filling out the following with as much detail as you can provide will help us answer your question sooner.)
@slack/bolt version
3.19.0
Your App and Receiver Configuration
const expressReceiver = new ExpressReceiver({
clientId: process.env.SLACK_CLIENT_ID,
clientSecret: process.env.SLACK_CLIENT_SECRET,
signingSecret: process.env.SLACK_SIGNING_SECRET,
stateSecret: '<state-secret>',
scopes: ['chat:write', 'commands', 'channels:history', 'groups:history', 'im:history', 'mpim:history', 'usergroups:read', 'channels:join'],
installationStore: installationStore,
logLevel: LogLevel.DEBUG
});
// Initializes your app with your bot token and signing secret
const app = new App({
receiver: expressReceiver,
processBeforeResponse: true,
logLevel: LogLevel.DEBUG
});Node.js runtime version
v20.15.0 locally
nodejs22.x on Lambda
Steps to reproduce:
I'm using @codegenie/serverless-express to wrap up the app for Serverless/Lambda
import serverlessExpress from '@codegenie/serverless-express';
...
export const handler = serverlessExpress({ app: expressReceiver.app });My app has a couple of shortcuts and a command that triggers views but I was able to reproduce the issue even just with the command trying to post a message.
app.command('/test', async ({ command, ack, client, logger }) => {
logger.debug('sending ack() ' + Date.now()); // overkill as ack() does it's own logging
await ack();
logger.debug('command: ' + JSON.stringify(command)); //
var result = await client.chat.postEphemeral({ channel: '<channel_id>', user: '<user_id>', text: 'test!' });
return result.ok ? result : result.error; // just trying to force Lambda to keep going, don't need this returned
});Expected result:
Lambda function runs long enough for the API request to complete
Actual result:
Nothing - the Lambda function appears to stop executing before the response from Slack is received and nothing happens for the user.
See the logs in CloudWatch

We see the ack and then the request for posting a message, gets as far as logging out the request then... nothing, no response, no error, the function just exits.
I'm sure this must be "just" an async/await issue where Lambda doesn't know to wait, but I just don't see what I've missed and can't find a comprehensive, reasonably up to date example.
All works fine locally using serverless offline and ngrok to tunnel my machine.
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. 🙇
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.