Skip to content

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

Closed
@domengabrovsek

Description

@domengabrovsek

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

Metadata

Metadata

Assignees

Labels

completedThis item is complete and has been merged/shippednot-a-bugNew and existing bug reports incorrectly submitted as bug

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions