aws-sdk-js-v3 icon indicating copy to clipboard operation
aws-sdk-js-v3 copied to clipboard

Peer dependency warning for abort-controller dependency in lib-storage

Open jekh opened this issue 3 years ago • 1 comments

Describe the bug

Installing @aws-sdk/lib-storage results in a missing peer dependency warning for @aws-sdk/abort-controller. @aws-sdk/lib-storage declares a peer dependency on @aws-sdk/abort-controller here. However, it looks like @aws-sdk/abort-controller is optional (lib-storage functions without it, as long as you don't want to abort), and it's also possible to use an alternate AbortController implementation.

Would it be possible to set the peerDependency to optional, using the the same method as this PR? https://github.com/aws/aws-sdk-js-v3/pull/3465 That should take care of unnecessary peer dependency warnings.

Expected Behavior

No peer dependency warning when @aws-sdk/abord-controller is not installed

Current Behavior

There is a peer dependency warning

Reproduction Steps

Add @aws-sdk/lib-storage to a project without @aws-sdk/abort-controller. pnpm is particularly good about showing missing peer dependency warnings.

Possible Solution

Adding a peerDependenciesMeta section to package.json with abort-controller set to optional should fix the issue:

 "peerDependenciesMeta": {
    "@aws-sdk/abort-controller": {
      "optional": true
    }
  },

Additional Information/Context

No response

SDK version used

3.121.0

Environment details (OS name and version, etc.)

Node 16

jekh avatar Jul 08 '22 19:07 jekh

@jekh thanks for opening this issue, I can discuss it with the team and open a PR for the solution.

ajredniwja avatar Aug 02 '22 18:08 ajredniwja

Up

nireld avatar Sep 11 '23 09:09 nireld

this is no longer applicable since lib-storage has no peerDependency on abort-controller anymore, as of v3.363.0.

kuhe avatar Feb 23 '24 19:02 kuhe

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

github-actions[bot] avatar Mar 09 '24 00:03 github-actions[bot]