-
Notifications
You must be signed in to change notification settings - Fork 399
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
v4.1.1 has inconsistent types with express v5 #2354
Comments
Hey @nickdirienzo 👋 Thanks for catching this! As I understand, the major version of Could you share how you stumbled into this? I'm wondering if it was caused by incompatible |
Thanks for jumping on this so quickly @zimeg! I didn't realize @types/express was pinned to ^4, so in our package.json we had it on 5.0.0 because of the express 5 upgrade. It looks like that PR should resolve the typing issue 🙏 What we're seeing in our development experience is we have a function like this: import { json as JsonMiddleware, type IRouter, Router } from "express";
// This is getting typed with v5
export const setupApiRoutes = (router: IRouter) => {
router.use("/v1", apiRouter);
}; Trying to pass in import { App, ExpressReceiver } from "@slack/bolt";
const receiver = new ExpressReceiver({
signingSecret: env.SLACK_SIGNING_SECRET,
clientId: env.SLACK_CLIENT_ID,
clientSecret: env.SLACK_CLIENT_SECRET,
stateSecret: env.SLACK_STATE_SECRET,
scopes,
installerOptions: {
directInstall: true,
},
installationStore: InstallationStore,
});
// This errors for us in our IDE
setupApiRoutes(receiver.router); |
🎉 Thanks so much for sharing this snippet! I can confirm the latest changes fix the compilation error this was causing. We have a release candidate prepared for the next patch version in #2347 which is undergoing testing now, but I'm hoping to land this change with the next release soon! |
So speedy! Thanks for following up on this so quickly! |
@slack/bolt
version4.1.1
Your
App
and Receiver ConfigurationN/A
Node.js runtime version
v21.7.3
Steps to reproduce:
Install @slack/bolt latest which installs express v5. The express types are set to ^4 in @slack/bolt's package.json but these aren't aligned with the version of Express being used.
Expected result:
@types/express should be 5.0.0 if Express v5 is used as far as I know.
Actual result:
@types/express v4 is used even though express v5 is installed.
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.
The text was updated successfully, but these errors were encountered: