Skip to content
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

Bug: Peer Dependency Conflict with @middy/core in Version 1.13.0 #1702

Closed
domengabrovsek opened this issue Sep 21, 2023 · 9 comments · Fixed by #1705
Closed

Bug: Peer Dependency Conflict with @middy/core in Version 1.13.0 #1702

domengabrovsek opened this issue Sep 21, 2023 · 9 comments · Fixed by #1705
Assignees
Labels
completed This item is complete and has been merged/shipped not-a-bug New and existing bug reports incorrectly submitted as bug

Comments

@domengabrovsek
Copy link

Expected Behaviour

This issue forces us to pin the logger version to 1.12.1 to avoid the build failure. It would be great if the peer dependencies could be aligned to support the latest versions of both packages.

npm install should complete without errors.

Current Behaviour

Up until now, I was using @aws-lambda-powertools/logger version ^1.12.1 and @middy/core version ^4.5.5 in my package.json. Since version 1.13.0 was released, my npm install fails with this error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @aws-lambda-powertools/logger@1.13.0
npm ERR! Found: @middy/core@4.6.4
npm ERR! node_modules/@middy/core
npm ERR!   @middy/core@"^4.5.5" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peerOptional @middy/core@">=3.x <4.x" from @aws-lambda-powertools/logger@1.13.0
npm ERR! node_modules/@aws-lambda-powertools/logger
npm ERR!   @aws-lambda-powertools/logger@"^1.12.1" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @middy/core@3.6.2
npm ERR! node_modules/@middy/core
npm ERR!   peerOptional @middy/core@">=3.x <4.x" from @aws-lambda-powertools/logger@1.13.0
npm ERR!   node_modules/@aws-lambda-powertools/logger
npm ERR!     @aws-lambda-powertools/logger@"^1.12.1" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /Users/domengabrovsek/.npm/_logs/2023-09-21T08_42_49_919Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/domengabrovsek/.npm/_logs/2023-09-21T08_42_49_919Z-debug-0.log

Upgrading to @aws-lambda-powertools/logger@1.13.0 breaks the build due to a peer dependency conflict with @middy/core.

Code snippet

not applicable

Steps to Reproduce

  1. Have the following package.json in your project:
    {
      "dependencies": {
        "@aws-lambda-powertools/logger": "^1.12.1",
        "@middy/core": "^4.5.5"
      }
    }
  2. Run npm install

OR

clone this repo https://github.com/domengabrovsek/aws-powertools-repro and run npm install

Possible Solution

No response

Powertools for AWS Lambda (TypeScript) version

1.13.0

AWS Lambda function runtime

18.x

Packaging format used

npm

Execution logs

No response

@domengabrovsek domengabrovsek added triage This item has not been triaged by a maintainer, please wait bug Something isn't working labels Sep 21, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Sep 21, 2023

Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #typescript channel on our Powertools for AWS Lambda Discord: Invite link

@dreamorosi dreamorosi added not-a-bug New and existing bug reports incorrectly submitted as bug rejected This is something we will not be working on. At least, not in the measurable future and removed bug Something isn't working triage This item has not been triaged by a maintainer, please wait labels Sep 21, 2023
@dreamorosi dreamorosi self-assigned this Sep 21, 2023
@am29d
Copy link
Contributor

am29d commented Sep 21, 2023

Hey @domengabrovsek thanks for raising the issue and apologies for the failed build caused by the new version.

We only support middy 3.x, and added only recently the peer dependency to make it explicit. As mentioned in #1694 we are very close to drop node14 support and can start moving to middy 4.x. in our major v2 release.

@domengabrovsek
Copy link
Author

Thank you @am29d for the explanation.

It surprised me because the build started failing without any changes on my side and I didn't notice any breaking changes related to this. I have been using tracer, logger, and metrics with middy 4.x for some time now and it has worked well. I'll pin the versions for now so I can continue working.

Thank you for everything you're doing with the powertools, it's a pleasure to use them!

@dreamorosi
Copy link
Contributor

Hi @domengabrovsek, thank you for opening this issue. As Alex mentioned this is something that was already documented both our documentation(see callout titled "A note about Middy") and Middy's documentation (here), however we should not have made this change in a minor release like we did.

We will make another emergency release today and remove the peer dependency. Then we'll revisit the topic in our next major version.

@am29d
Copy link
Contributor

am29d commented Sep 21, 2023

Hey @domengabrovsek , it was great that it worked with 4.x before 😄 .

@dreamorosi and I had a chat and we agreed that it'd be best to remove the upper bound on middy 4.x to unblock you and potentially many others. I will make a quick release soon.

Thanks again for raising this issue, which helps us to address breaking builds quickly 🙏.

@domengabrovsek
Copy link
Author

Thank you @am29d and @dreamorosi for such a fast response! 🙏

@alenkoso
Copy link

This is pretty wholesome, how you guys have responded so rapidly and even offered to help the community with a new release. :)

@dreamorosi dreamorosi added confirmed The scope is clear, ready for implementation and removed rejected This is something we will not be working on. At least, not in the measurable future labels Sep 21, 2023
@dreamorosi dreamorosi linked a pull request Sep 21, 2023 that will close this issue
9 tasks
@github-project-automation github-project-automation bot moved this from Working on it to Coming soon in Powertools for AWS Lambda (TypeScript) Sep 21, 2023
@github-actions
Copy link
Contributor

⚠️ COMMENT VISIBILITY WARNING ⚠️

Comments on closed issues 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.

@github-actions github-actions bot added pending-release This item has been merged and will be released soon and removed confirmed The scope is clear, ready for implementation labels Sep 21, 2023
@github-actions
Copy link
Contributor

This is now released under v1.13.1 version!

@github-actions github-actions bot added completed This item is complete and has been merged/shipped and removed pending-release This item has been merged and will be released soon labels Sep 21, 2023
@dreamorosi dreamorosi moved this from Coming soon to Shipped in Powertools for AWS Lambda (TypeScript) Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed This item is complete and has been merged/shipped not-a-bug New and existing bug reports incorrectly submitted as bug
Projects
Development

Successfully merging a pull request may close this issue.

4 participants