Closed BrianTsGit closed 4 months ago
@BrianTsGit / @seratch I am seeing similar issues:
TypeError: request.blob is not a function
at SlackApp.handleEventRequest (/Users/patrickiwanicki/Repos/ask-ai-slackbot/node_modules/slack-edge/src/app.ts:750:43)
at SlackApp.run (/Users/patrickiwanicki/Repos/ask-ai-slackbot/node_modules/slack-edge/src/app.ts:705:23)
at handler (/Users/patrickiwanicki/Repos/ask-ai-slackbot/api/edge.ts:20:20)
at Server.<anonymous> (file:///Users/patrickiwanicki/.nvm/versions/node/v20.10.0/lib/node_modules/vercel/node_modules/@vercel/node/dist/dev-server.mjs:1027:12)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
@BrianTsGit
I can see the app is returning a 401 response to the challenge request.
This means your app in prod does not have a valid signing secret in its env variables. Please double-check if you've set a correct string for the app. I'd suggest using vercel env pull
command for downloading the currently set ones.
The "Code Snippet 2" never works. Please stop doing it. When you configure your vercel env
correctly, the code snippet on README should work without any changes. Grab the latest credentials again and run the following commands to set them:
vercel env add SLACK_BOT_TOKEN production
vercel env add SLACK_SIGNING_SECRET production
I've confirmed that the latest Next.js and the code snippet on README are compatible and while doing the check, I've observed there is a certain delay on the Vercel platform isde. When you have issues with loading env data, waiting for a while (say, minutes?) may help.
I did confirm that there is no issue with the code on README:
Give another try without any code changes! I hope you'll figure the cause of your error out soon
@screengroove Your situation looks a bit different. if you're experiencing the error on your local machine (or somewhere outside of the Vercel prod infra), it might be due to some errors opn your settings, outdated runtime/module etc.
Since I don't have the bandwidth for general Vercel questions (this is my weekend project plus I am not a Vercel employee), I'd like to avoid back and forth comments here (except the issue directly caused by this library). Ask questions on their forum for further supports.
Hey @seratch, it did end up being an issue with env vars. Thank you for that, the demo code is running as expected now!
Hi there, I am running into a few issues using the SlackApp object in a NextJS project using App Router. I might be missing some configurations but as I follow the example in the README for the Vercel Edge Functions I run into some problems you may be able to shed some light on.
package.json:
Code Snippet 1:
When challenging this endpoint
api/slack
from Slack's Event Subscription there is no successful response to verify the endpoint. Is there any missing configuration to enable the SlackApp to return the challenge? I can see the app is returning a 401 response to the challenge request.In an attempt to get pass the verification step I manually return the challenge in the following updated snippet. However, then I run into an error originating from the slack-edge library when hitting the endpoint from an app mention in Slack.
Code Snippet 2:
Error from Code Snippet 2:
It appears SlackApp.run is having issues calling
.blob
on the NextRequest. This might be because I already called.blob
on the request during my manual challenge verification step. But without that I can not reach the point in the route handler to runSlackApp.run
.Perhaps I am missing something here or configured something incorrectly. Thank you for any feedback!