Skip to content

S3 type incompatibilities in 3.726.0/3.726.1 generate TS2345 & TS2308 errorsΒ #6796

@KeithGillette

Description

@KeithGillette

Checkboxes for prior research

Describe the bug

Updating a project with @aws-sdk/client-s3, @aws-sdk/s3-request-presigner, & @aws-sdk/util-create-request from 3.723.0 to 3.726.0 or 3.726.1 generates TS2345 & TS2308 errors upon running tsc.

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/[email protected], @aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.17.0

Reproduction Steps

  1. Using latest S3 from [email protected] (or 3.726.1) and latest createRequest from @aws-sdk/[email protected] similar to:
import { DeleteObjectsOutput, GetObjectCommand, GetObjectOutput, PutObjectOutput, S3, S3ClientConfig } from '@aws-sdk/client-s3';
import { createRequest } from '@aws-sdk/util-create-request';

const s3Client = new S3({
	credentials: {
		accessKeyId: accessTokenResponse.key,
		secretAccessKey: accessTokenResponse.secret,
	},
	region: environment.ContentBucketRegion,
});
await createRequest(
	s3Client, // TS2345: Argument of type S3 is not assignable to parameter of type Client<any, ServiceInputTypes, MetadataBearer, any> Types have separate declarations of a private property handler
	new GetObjectCommand({
		Bucket: environment.ContentBucketName,
		Key: FileStorageService.getS3ObjectKey(payload),
	}),
)

Observed Behavior

tsc generates:

 error TS2345: Argument of type 'S3' is not assignable to parameter of type 'Client<any, ServiceInputTypes, MetadataBearer, any>'.
  Types have separate declarations of a private property 'handlers'.
node_modules/@aws-sdk/s3-request-presigner/node_modules/@smithy/core/protocols.d.ts(6,3): error TS2308: Module "@smithy/core/dist-types/submodules/protocols/index.d" has already exported a member named 'RequestBuilder'. Consider explicitly re-exporting to resolve the ambiguity.
node_modules/@aws-sdk/s3-request-presigner/node_modules/@smithy/core/protocols.d.ts(6,3): error TS2308: Module "@smithy/core/dist-types/submodules/protocols/index.d" has already exported a member named 'collectBody'. Consider explicitly re-exporting to resolve the ambiguity.
node_modules/@aws-sdk/s3-request-presigner/node_modules/@smithy/core/protocols.d.ts(6,3): error TS2308: Module "@smithy/core/dist-types/submodules/protocols/index.d" has already exported a member named 'extendedEncodeURIComponent'. Consider explicitly re-exporting to resolve the ambiguity.
node_modules/@aws-sdk/s3-request-presigner/node_modules/@smithy/core/protocols.d.ts(6,3): error TS2308: Module "@smithy/core/dist-types/submodules/protocols/index.d" has already exported a member named 'requestBuilder'. Consider explicitly re-exporting to resolve the ambiguity.
node_modules/@aws-sdk/s3-request-presigner/node_modules/@smithy/core/protocols.d.ts(6,3): error TS2308: Module "@smithy/core/dist-types/submodules/protocols/index.d" has already exported a member named 'resolvedPath'. Consider explicitly re-exporting to resolve the ambiguity.

Expected Behavior

Minor version update would not introduce incompatible types.

Possible Solution

No response

Additional Information/Context

No response

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p2This is a standard priority issuepotential-regressionMarking this issue as a potential regression to be checked by team member

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions