Skip to content

Could not resolve "@aws-sdk/client-s3" #356

Description

@aichichang

Issue

@aws-sdk/client-s3 peerDependency range out of sync with devDependency

Our team encountered this error after bumping lambda-api to the latest version. The same issue did not occur with @aws-sdk/s3-request-presigner, which has consistent versions across peer and dev dependencies.

✘ [ERROR] Could not resolve "@aws-sdk/client-s3"

    ../node_modules/lambda-api/dist/esm/lib/s3-service.js:19:42:
      19 │         const { S3Client } = await import('@aws-sdk/client-s3');
         ╵                                           ~~~~~~~~~~~~~~~~~~~~

  You can mark the path "@aws-sdk/client-s3" as external to exclude it from the bundle, which will
  remove this error and leave the unresolved path in the bundle. You can also add ".catch()" here to
  handle this failure at run-time instead of bundle-time.

1 error
npm error Lifecycle script `build` failed with error:
npm error code 1
npm error path /Users/aichi.chang/krakenflex/schedules/schedules-api
npm error workspace schedules-api@1.0.0
npm error location /Users/aichi.chang/krakenflex/schedules/schedules-api
npm error command failed

peerDependencies declares @aws-sdk/client-s3: "^3.470.0" but devDependencies pins 3.1106.0. Since the library is developed and tested against 3.1106.0, consumers constrained to ^3.470.0 may hit runtime or build failures. @aws-sdk/s3-request-presigner is at 3.470.0 in both — which is why only client-s3 is affected.

Would it be possible to bump the @aws-sdk/client-s3 peerDependency to "^3.1106.0"?

Environment

npm: 10
node: 22

Workaround

We made @aws-sdk/client-s3 as an external package in the build command resolves the error, but feels like a workaround rather than a proper fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions