Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missed tslib dependency in @aws-sdk/types 3.199.0 #4075

Closed
3 tasks done
koshic opened this issue Oct 21, 2022 · 5 comments
Closed
3 tasks done

Missed tslib dependency in @aws-sdk/types 3.199.0 #4075

koshic opened this issue Oct 21, 2022 · 5 comments
Assignees
Labels
bug This issue is a bug. closed-for-staleness

Comments

@koshic
Copy link

koshic commented Oct 21, 2022

Checkboxes for prior research

Describe the bug

Base tsconfig for cjs has importHelpers: true, so 'tslib' must be in dependencies for any compiled package:

"compilerOptions": {
"importHelpers": true,
"module": "commonjs",

'types' package has no dependencies, only devDependencies:

"devDependencies": {
"@tsconfig/recommended": "1.0.1",
"concurrently": "7.0.0",
"downlevel-dts": "0.10.1",
"rimraf": "3.0.2",
"typedoc": "0.19.2",
"typescript": "~4.6.2"
}

It could be ok for types-only (in TS terms) package, but 'middleware-sdk-s3' imports EndpointURLScheme enum from 'types' package:

import { Endpoint, EndpointURL, EndpointURLScheme } from "@aws-sdk/types";
import { isIpAddress } from "./isIpAddress";
const DEFAULT_PORTS: Record<EndpointURLScheme, number> = {
[EndpointURLScheme.HTTP]: 80,
[EndpointURLScheme.HTTPS]: 443,
};

And yes, dist-cjs/index.js requires 'tslib':
image

As a result, we have an error inside strict environment like Yarn PnP:

@aws-sdk/types tried to access tslib, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: tslib
Required by: @aws-sdk/types@npm:3.193.0 (via <doesnt matter>/.yarn/cache/@aws-sdk-types-npm-3.193.0-3d57d20985-2979d25628.zip/node_modules/@aws-sdk/types/)

In my case stack trace begins from 's3-client'.

SDK version number

3.194.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v19.0.0

Reproduction Steps

yarn pnp, cjs, s3-client and SelectObjectContentCommand.

Observed Behavior

'missed dependency'

Expected Behavior

no error

Possible Solution

add missed dependency to 'types' package

Additional Information/Context

No response

@koshic koshic added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 21, 2022
@koshic koshic changed the title Missed tslib dependency in @aws-sdk/[email protected] Missed tslib dependency in @aws-sdk/types 3.193.0 Oct 21, 2022
@koshic koshic changed the title Missed tslib dependency in @aws-sdk/types 3.193.0 Missed tslib dependency in @aws-sdk/types 3.194.0 Oct 21, 2022
@dszczepaniak-cksource
Copy link

I can confirm the issue occurs for @[email protected] as well

@ajredniwja ajredniwja self-assigned this Oct 24, 2022
@koshic
Copy link
Author

koshic commented Oct 27, 2022

Still actual in 3.197.0

@lensbart
Copy link

Encountered the issue in 3.199.0

@koshic koshic changed the title Missed tslib dependency in @aws-sdk/types 3.194.0 Missed tslib dependency in @aws-sdk/types 3.199.0 Oct 29, 2022
@mhassan1
Copy link
Contributor

mhassan1 commented Nov 1, 2022

This should be resolved by #4128.

@kuhe kuhe added closing-soon This issue will automatically close in 4 days unless further comments are made. and removed needs-triage This issue or PR still needs to be triaged. labels Dec 7, 2022
@github-actions github-actions bot added closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Dec 8, 2022
@github-actions github-actions bot closed this as completed Dec 8, 2022
@github-actions
Copy link

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 github-actions bot locked as resolved and limited conversation to collaborators Dec 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. closed-for-staleness
Projects
None yet
Development

No branches or pull requests

6 participants