Skip to content

Unannounced breaking changes: v2.24.1 zod peer dependency #4375

@niklash3

Description

@niklash3

Expected Behavior

Hi!

In commit 7a65fcf9759ac1a1f072ef5442ee8b0767705a92 (version 2.24.1) you bumped the zod peer dependency from v3 to v4, which is considered a breaking change according to semver.

This leads to downstream libraries which are still using zod 3 to experience NPM install failures such as the following:

npm error While resolving: @aws-lambda-powertools/parser@2.25.1
npm error Found: zod@3.25.76
npm error node_modules/zod
npm error   zod@"^3.25.42" from the root project
npm error
npm error Could not resolve dependency:
npm error peerOptional zod@"4.x" from @aws-lambda-powertools/parser@2.25.1
npm error node_modules/@aws-lambda-powertools/parser
npm error   @aws-lambda-powertools/parser@"^2.20.0" from the root project
npm error
npm error Conflicting peer dependency: zod@4.1.1
npm error node_modules/zod
npm error   peerOptional zod@"4.x" from @aws-lambda-powertools/parser@2.25.1
npm error   node_modules/@aws-lambda-powertools/parser
npm error     @aws-lambda-powertools/parser@"^2.20.0" from the root project

I guess this is unactionable now unless you want to yank all versions since 2.24.1 and release a new major version... However, do keep this in mind for future peer dependency updates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    not-a-bugNew and existing bug reports incorrectly submitted as bugparserThis item relates to the Parser Utility

    Type

    No type

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions