Skip to content

@smithy/types InconsistencyΒ #7317

@bestickley

Description

@bestickley

Checkboxes for prior research

Describe the bug

I have the following dependencies in my pnpm-workspace.yaml (catalog):

'@aws-sdk/client-api-gateway': ^3.882.0
  '@aws-sdk/client-dynamodb': ^3.882.0
  '@aws-sdk/client-iam': ^3.882.0
  '@aws-sdk/client-secrets-manager': ^3.882.0
  '@aws-sdk/client-sts': ^3.882.0
  '@aws-sdk/credential-providers': ^3.882.0
  '@aws-sdk/lib-dynamodb': ^3.882.0
  '@aws-sdk/rds-signer': ^3.882.0

I started getting type errors about @smithy/types:

Argument of type 'GetCommand' is not assignable to parameter of type 'Command<ServiceInputTypes, GetItemCommandInput | GetCommandInput, ServiceOutputTypes, ServiceOutputTypes, SmithyResolvedConfiguration<...>>'.
  The types of 'middlewareStack.add' are incompatible between these types.
    Type '{ (middleware: InitializeMiddleware<GetItemCommandInput | GetCommandInput, GetItemCommandOutput | GetCommandOutput>, options?: (InitializeHandlerOptions & AbsoluteLocation) | undefined): void; (middleware: SerializeMiddleware<...>, options: SerializeHandlerOptions & AbsoluteLocation): void; (middleware: BuildMiddlew...' is not assignable to type '{ (middleware: InitializeMiddleware<GetItemCommandInput | GetCommandInput, ServiceOutputTypes>, options?: (InitializeHandlerOptions & AbsoluteLocation) | undefined): void; (middleware: SerializeMiddleware<...>, options: SerializeHandlerOptions & AbsoluteLocation): void; (middleware: BuildMiddleware<...>, options: Bu...'.
      Types of parameters 'middleware' and 'middleware' are incompatible.
        Types of parameters 'context' and 'context' are incompatible.
          Type 'import("/Users/stickb/Code/census/llm-research/node_modules/.pnpm/@[email protected]/node_modules/@smithy/types/dist-types/middleware").HandlerExecutionContext' is not assignable to type 'import("/Users/stickb/Code/census/llm-research/node_modules/.pnpm/@[email protected]/node_modules/@smithy/types/dist-types/middleware").HandlerExecutionContext'.
            Types of property '[SMITHY_CONTEXT_KEY]' are incompatible.
              Type '{ [key: string]: unknown; service?: string | undefined; operation?: string | undefined; commandInstance?: import("/Users/stickb/Code/census/llm-research/node_modules/.pnpm/@[email protected]/node_modules/@smithy/types/dist-types/command").Command<any, any, any, any, any> | undefined; selectedHttpAuthScheme?: import...' is not assignable to type '{ [key: string]: unknown; service?: string | undefined; operation?: string | undefined; commandInstance?: import("/Users/stickb/Code/census/llm-research/node_modules/.pnpm/@[email protected]/node_modules/@smithy/types/dist-types/command").Command<any, any, any, any, any> | undefined; selectedHttpAuthScheme?: import...'.
                Type '{ [key: string]: unknown; service?: string | undefined; operation?: string | undefined; commandInstance?: import("/Users/stickb/Code/census/llm-research/node_modules/.pnpm/@[email protected]/node_modules/@smithy/types/dist-types/command").Command<any, any, any, any, any> | undefined; selectedHttpAuthScheme?: import...' is not assignable to type '{ [key: string]: unknown; service?: string | undefined; operation?: string | undefined; commandInstance?: import("/Users/stickb/Code/census/llm-research/node_modules/.pnpm/@[email protected]/node_modules/@smithy/types/dist-types/command").Command<any, any, any, any, any> | undefined; selectedHttpAuthScheme?: import...'.
                  Types of property 'commandInstance' are incompatible.
                    Type 'import("/Users/stickb/Code/census/llm-research/node_modules/.pnpm/@[email protected]/node_modules/@smithy/types/dist-types/command").Command<any, any, any, any, any> | undefined' is not assignable to type 'import("/Users/stickb/Code/census/llm-research/node_modules/.pnpm/@[email protected]/node_modules/@smithy/types/dist-types/command").Command<any, any, any, any, any> | undefined'.
                      Type 'import("/Users/stickb/Code/census/llm-research/node_modules/.pnpm/@[email protected]/node_modules/@smithy/types/dist-types/command").Command<any, any, any, any, any>' is not assignable to type 'import("/Users/stickb/Code/census/llm-research/node_modules/.pnpm/@[email protected]/node_modules/@smithy/types/dist-types/command").Command<any, any, any, any, any>'.
                        The types of 'middlewareStack.add' are incompatible between these types.
                          Type '{ (middleware: import("/Users/stickb/Code/census/llm-research/node_modules/.pnpm/@[email protected]/node_modules/@smithy/types/dist-types/middleware").InitializeMiddleware<any, any>, options?: (import("/Users/stickb/Code/census/llm-research/node_modules/.pnpm/@[email protected]/node_modules/@smithy/types/dist-type...' is not assignable to type '{ (middleware: import("/Users/stickb/Code/census/llm-research/node_modules/.pnpm/@[email protected]/node_modules/@smithy/types/dist-types/middleware").InitializeMiddleware<any, any>, options?: (import("/Users/stickb/Code/census/llm-research/node_modules/.pnpm/@[email protected]/node_modules/@smithy/types/dist-type...'.
                            Types of parameters 'options' and 'options' are incompatible.
                              Type 'SerializeHandlerOptions & AbsoluteLocation' is not assignable to type '(InitializeHandlerOptions & AbsoluteLocation) | undefined'.
                                Type 'SerializeHandlerOptions & AbsoluteLocation' is not assignable to type 'InitializeHandlerOptions & AbsoluteLocation'.
                                  Type 'SerializeHandlerOptions & AbsoluteLocation' is not assignable to type 'InitializeHandlerOptions'.
                                    Types of property 'step' are incompatible.
                                      Type '"serialize"' is not assignable to type '"initialize"'.

I deleted my lockfile and re-installed but I'm still getting same error. I see in my lock file that it seems like internal aws-sdk packages have 4.4 but the clients have 4.3.2. Please resolve.

Regression Issue

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

SDK version number

@aws-sdk/package-name@version, ...

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v22.18.0

Reproduction Steps

see above

Observed Behavior

type error

Expected Behavior

no type error

Possible Solution

Work around in pnpm-workspace.yaml:

...
overrides:
  '@smithy/types': ~4.3.2

Additional Information/Context

No response

Metadata

Metadata

Labels

bugThis issue is a bug.closed-for-stalenesspotential-regressionMarking this issue as a potential regression to be checked by team memberresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions