-
Notifications
You must be signed in to change notification settings - Fork 146
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
Feature request: Support Middy 5.x #2049
Comments
Hi @saragerion thank you for opening this issue. At the moment we don't have concrete plans for officially supporting Middy.js v5, however when the time comes I expect there will be challenges due to Powertools supporting both CJS and ESM and Middy.js having dropped support for the former in their v5 major version. According to our versioning policy we are committed to supporting all current AWS Lambda managed runtimes, which at the time of writing are the ones corresponding to Node.js 16 through Node.js 20. On Middy.js side, their release cadence aligns more closely with the Node.js LTS policy. This means that v5 dropped support for Node.js 16. For the time being, I'd suggest customers to stick with v4 if they're using mainly the With this in mind, and according to the latest info publicly available on the AWS Lambda Runtime versioning policy, the earliest we can consider support for Middy.js 5x is going to be late Q2/early Q3, which is when we're expected to also drop support for Node.js 16. I'm going to mark this as an item to revisit in the next quarter, but it would be useful for us to have customers interested in the feature react with a 👍 to this issue as this will help us understand demand. |
To add to this, a number of issues regarding middy v5 have been popping up as of late. There are a number of type conflicts and issues with bundling middy v5 using various frameworks. Revisiting in another couple of months seems like a good next step. |
In the next release we are going to drop support for Node.js 16, which means we can now look into extending support to Middy.js v5.x. Based on the reactions to my last message above, there seems to be significant interest in us adding support to Middy.js 5.x despite it dropping support for CJS. I have already started testing some of our utilities with the newer version in some samples & demos, but before officially adding support we'll need to look into adding the version to our test matrix. |
This issue is now closed. Please be mindful that future comments are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so. |
This is now released under v2.4.0 version! |
Hello, my lambda function seems to to be throwing "No "exports" main defined in /var/task/node_modules/@middy/core/package.json" now even though we saw this fixed for a while Using the following versions:
This is how we're using Middy
Thank you |
As mentioned in the issue you've opened on middyjs/middy#1208, this is most likely happening because you're transpiling your TypeScript code to CommonJS while Middy.js 5.x only supports ESM. As the stack trace suggests, the root cause of the issue is Middy.js and not Powertools for AWS, nor AWS Lambda itself. Without knowing how you are transpiling or bundling your code, I can't make any specific suggestions, but if you are using CDK like shared in the other issue, then you need to instruct If this is still an issue and either 1/ you are sure that are using ESM but it still doesn't work, or 2/ would like Middy.js to support CJS, I would suggest to follow up with them on their repo. |
Use case
This feature request is about an upcoming official support of Middy 5.x.
The current Powertools version 1.18.0 officially supports Middy up until version 3, as described in the documentation.
Support for Middy v4 is expected to be launched soon as part of the upcoming major release 2.x.
If and when Middy v5 will be officially supported, it would be good to guide developers on what changes they need to implement in their codebase to successfully leverage the Logger utility together with Middy v5.
Solution/User Experience
Upgrading to Middy v5 may have a significant impact on the codebase and developer experience.
See Middy's documentation for more info.
Alternative solutions
No response
Acknowledgment
Future readers
Please react with 👍 and your use case to help us understand customer demand.
The text was updated successfully, but these errors were encountered: