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/node-config-provider should be a full dependency of @aws-sdk/config-resolver #4481

Closed
3 tasks done
jfirebaugh opened this issue Feb 28, 2023 · 5 comments · Fixed by #5223
Closed
3 tasks done
Assignees
Labels
bug This issue is a bug. p3 This is a minor priority issue s Effort estimation: small

Comments

@jfirebaugh
Copy link

Checkboxes for prior research

Describe the bug

@aws-sdk/config-resolver lists @aws-sdk/node-config-provider as a devDependency, but depends on it for types, so it should be a full dependency.

This is the same as #4191 but with full reproduction steps.

SDK version number

@aws-sdk/config-resolver@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

@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

@RanVaknin Is there a way around this in the meantime?

@troycarlson
Copy link

@spbarber pnpm supports patching package definitions via the pnpm.packageExtensions field in your package.json file, which will look something like this:

{
  name: "your project name",
  dependencies: {
    "@aws-sdk/client-s3": "^3.338.0"
  },
  "pnpm": {
    "packageExtensions": {
      "@aws-sdk/config-resolver": {
        "dependencies": {
          "@aws-sdk/node-config-provider": "*"
        }
      }
    }
  }
}

Which essentially tells pnpm to treat @aws-sdk/node-config-provider as a dependency of @aws-sdk/config-resolver (instead of a dev dependency). You can also specify versions and patch other attributes of packages you depend on, but this should solve the issue at hand.

@jfirebaugh
Copy link
Author

@aws-sdk/middleware-endpoint-discovery has the same issue.

"@aws-sdk/node-config-provider": "*",

@github-actions
Copy link

github-actions bot commented Oct 3, 2023

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 Oct 3, 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. p3 This is a minor priority issue s Effort estimation: small
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants