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

@aws-sdk/types should be a full dependency of @aws-sdk/util-retry #4482

Closed
3 tasks done
jfirebaugh opened this issue Feb 28, 2023 · 7 comments
Closed
3 tasks done

@aws-sdk/types should be a full dependency of @aws-sdk/util-retry #4482

jfirebaugh opened this issue Feb 28, 2023 · 7 comments
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue queued This issues is on the AWS team's backlog s Effort estimation: small

Comments

@jfirebaugh
Copy link

Checkboxes for prior research

Describe the bug

@aws-sdk/util-retry lists @aws-sdk/types as a devDependency, but depends on it for types, so it should be a full dependency.

SDK version number

@aws-sdk/util-retry@3.272.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v16.17.1

Reproduction Steps

pnpm init
pnpm i @aws-sdk/client-secrets-manager typescript
echo "hoist=false" >.npmrc

tsconfig.json:

{
  "compilerOptions": {
    "lib": ["es2018", "dom"],
  }
}

index.ts:

import { SecretsManagerClient, GetSecretValueCommand } from '@aws-sdk/client-secrets-manager';

(async () => {
    const client = new SecretsManagerClient({ region: 'us-west-2' });
    const response = await client.send(new GetSecretValueCommand({
        SecretId: 'somekey'
    }))
    console.log(response)
})().then(console.log).catch(console.log)

Run pnpm tsc.

Observed Behavior

node_modules/.pnpm/@aws-sdk+config-resolver@3.272.0/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/NodeUseDualstackEndpointConfigOptions.d.ts:1:39 - error TS2307: Cannot find module '@aws-sdk/node-config-provider' or its corresponding type declarations.

1 import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider";
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@aws-sdk+config-resolver@3.272.0/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/NodeUseFipsEndpointConfigOptions.d.ts:1:39 - error TS2307: Cannot find module '@aws-sdk/node-config-provider' or its corresponding type declarations.

1 import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider";
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@aws-sdk+config-resolver@3.272.0/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/config.d.ts:1:59 - error TS2307: Cannot find module '@aws-sdk/node-config-provider' or its corresponding type declarations.

1 import { LoadedConfigSelectors, LocalConfigOptions } from "@aws-sdk/node-config-provider";
                                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@aws-sdk+middleware-retry@3.272.0/node_modules/@aws-sdk/middleware-retry/dist-types/configurations.d.ts:1:39 - error TS2307: Cannot find module '@aws-sdk/node-config-provider' or its corresponding type declarations.

1 import { LoadedConfigSelectors } from "@aws-sdk/node-config-provider";
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@aws-sdk+util-retry@3.272.0/node_modules/@aws-sdk/util-retry/dist-types/AdaptiveRetryStrategy.d.ts:1:91 - error TS2307: Cannot find module '@aws-sdk/types' or its corresponding type declarations.

1 import { Provider, RetryErrorInfo, RetryStrategyV2, RetryToken, StandardRetryToken } from "@aws-sdk/types";
                                                                                            ~~~~~~~~~~~~~~~~

node_modules/.pnpm/@aws-sdk+util-retry@3.272.0/node_modules/@aws-sdk/util-retry/dist-types/StandardRetryStrategy.d.ts:1:79 - error TS2307: Cannot find module '@aws-sdk/types' or its corresponding type declarations.

1 import { Provider, RetryErrorInfo, RetryStrategyV2, StandardRetryToken } from "@aws-sdk/types";
                                                                                ~~~~~~~~~~~~~~~~


Found 6 errors in 6 files.

Errors  Files
     1  node_modules/.pnpm/@aws-sdk+config-resolver@3.272.0/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/NodeUseDualstackEndpointConfigOptions.d.ts:1
     1  node_modules/.pnpm/@aws-sdk+config-resolver@3.272.0/node_modules/@aws-sdk/config-resolver/dist-types/endpointsConfig/NodeUseFipsEndpointConfigOptions.d.ts:1
     1  node_modules/.pnpm/@aws-sdk+config-resolver@3.272.0/node_modules/@aws-sdk/config-resolver/dist-types/regionConfig/config.d.ts:1
     1  node_modules/.pnpm/@aws-sdk+middleware-retry@3.272.0/node_modules/@aws-sdk/middleware-retry/dist-types/configurations.d.ts:1
     1  node_modules/.pnpm/@aws-sdk+util-retry@3.272.0/node_modules/@aws-sdk/util-retry/dist-types/AdaptiveRetryStrategy.d.ts:1
     1  node_modules/.pnpm/@aws-sdk+util-retry@3.272.0/node_modules/@aws-sdk/util-retry/dist-types/StandardRetryStrategy.d.ts:1

Expected Behavior

Compiles successfully.

Possible Solution

No response

Additional Information/Context

No response

@jfirebaugh jfirebaugh added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 28, 2023
@jfirebaugh
Copy link
Author

Please also consider testing with pnpm and hoisting disabled to ensure that aws-sdk does not accidentally add "phantom dependencies" in the future.

@yenfryherrerafeliz yenfryherrerafeliz self-assigned this Mar 1, 2023
@RanVaknin RanVaknin added the p3 This is a minor priority issue label Mar 2, 2023
@yenfryherrerafeliz yenfryherrerafeliz added s Effort estimation: small and removed needs-triage This issue or PR still needs to be triaged. labels Mar 3, 2023
@spbarber
Copy link

spbarber commented Mar 8, 2023

I am also getting the same issue when using yarn.

Any way to get around this?

@andrew-rowley
Copy link

andrew-rowley commented Mar 31, 2023

me too .. we added packageExtensions rules to our .yarnrc.yml to resolve

@spbarber
Copy link

Do you have an example of what that looks like?

@andrew-rowley
Copy link

Do you have an example of what that looks like?

packageExtensions:
  "@aws-sdk/config-resolver@*":
    dependencies:
      "@aws-sdk/node-config-provider": "*"
  "@aws-sdk/middleware-retry@*":
    dependencies:
      "@aws-sdk/node-config-provider": "*"
  "@aws-sdk/util-retry@*":
    dependencies:
      "@aws-sdk/types": "*"

@spbarber
Copy link

spbarber commented Apr 3, 2023

Worked like a charm. Thanks very much 😄

@RanVaknin RanVaknin added p2 This is a standard priority issue queued This issues is on the AWS team's backlog and removed p3 This is a minor priority issue labels Jun 23, 2023
@kuhe kuhe closed this as completed Sep 15, 2023
@kuhe kuhe self-assigned this Sep 15, 2023
@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 Sep 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. p2 This is a standard priority issue queued This issues is on the AWS team's backlog s Effort estimation: small
Projects
None yet
Development

No branches or pull requests

6 participants