Skip to content

AWS Smithy Client Middleware Issue #7533

@samchungy

Description

@samchungy

Checkboxes for prior research

Describe the bug

Since upgrading to 3.9.4 we've been running into

{"errorType":"Error","errorMessage":"serializerMiddleware is not found when adding endpointV2Middleware middleware before serializerMiddleware","stack":["Error: serializerMiddleware is not found when adding endpointV2Middleware middleware before serializerMiddleware","    at /var/runtime/node_modules/@aws-sdk/node_modules/@smithy/middleware-stack/dist-cjs/index.js:146:17","    at Array.forEach (<anonymous>)","    at getMiddlewareList (/var/runtime/node_modules/@aws-sdk/node_modules/@smithy/middleware-stack/dist-cjs/index.js:139:31)","    at Object.resolve (/var/runtime/node_modules/@aws-sdk/node_modules/@smithy/middleware-stack/dist-cjs/index.js:280:32)","    at GetSecretValueCommand.resolveMiddlewareWithContext (/var/task/node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-cjs/index.js:113:22)","    at GetSecretValueCommand.resolveMiddleware (/var/task/node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-cjs/index.js:193:29)","    at SecretsManagerClient.send (/var/runtime/node_modules/@aws-sdk/node_modules/@smithy/smithy-client/dist-cjs/index.js:81:25)","

Regression Issue

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

SDK version number

@aws-sdk/client-secrets-manager: 3.940.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v22.20.0

Reproduction Steps

I can't seem to reproduce this locally but it happens within our Lambdas.

I believe it's due to our bundled aws-sdk version pulling in the Lambda runtime's @smithy/middleware-stack?

Observed Behavior

    const getSecretParams: GetSecretValueRequest = {
      SecretId: secretId,
    };
    const command = new GetSecretValueCommand(getSecretParams);

    const secretValue = await sm.send(command);

    return JSON.parse(
      secretValue.SecretString as string,
    ) as unknown as PrivateKey;

Expected Behavior

It should run without erroring

Possible Solution

No response

Additional Information/Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions