Skip to content

Lambda InvokeCommand payload with UInt8Array type #1433

@samirda

Description

@samirda

Describe the bug
Produces error when calling InvokeCommand with Payload type UInt8Array

SDK version number
Gamma 6

Is the issue in the browser/Node.js/ReactNative?
Node.js

Details of the browser/Node.js/ReactNative version
v14.5.0

To Reproduce (observed behavior)

await lambda.send(new InvokeCommand({
  FunctionName: '<FunctionName>',
  Payload: new TextEncoder().encode('abc') //Uint8Array
}))

(node:54212) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer. Received an instance of Uint8Array

await lambda.send(new InvokeCommand({
  FunctionName: '<FunctionName>',
  Payload: '"abc"' as any
}))

Works as expected

Expected behavior
Payload with UInt8Array type to not throw error or change Payload type to string | Buffer

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions