Minimal reproduction of the issue in Cannot read property 'byteLength' of undefined #2437
- Created new
ElasticTranscoderClient
instance; - Created new
CreateJobCommand
instance; - Used
ElasticTranscoderClient
tosend
CreateJobCommand
, which returnsTypeError: undefined is not an object (evaluating 'data.byteLength')
.
@aws-sdk/client-elastic-transcoder@3.21.0
ReactNative
0.64.2
This repo is a complete reproducible example. Either way, you can find an exert of the code down below:
const client: ElasticTranscoderClient =
new ElasticTranscoderClient<ElasticTranscoderClientConfig>({
credentials: {
AccessKeyId: AWS_ACCESS_KEY_ID,
SecretAccessKey: AWS_SECRET_ACCESS_KEY,
},
region: AWS_STORAGE_MEDIA_INPUT_BUCKET_REGION,
});
const command: CreateJobCommand =
new CreateJobCommand<CreateJobCommandInput>({
PipelineId: AWS_ELASTIC_TRANSCODER_PIPELINE_ID,
Inputs: [
{
Key: INPUT_FILE_KEY,
},
],
Outputs: [
{
Key: INPUT_FILE_KEY + '/hls_1000k_',
PresetId: '1351620000001-200030',
SegmentDuration: '1',
ThumbnailPattern: '{resolution}_{count}',
},
],
});
try {
const data = await client.send(command);
} catch (error) {
console.error(error);
} finally {
// finally.
}
Executing client.send(command)
catches a TypeError: undefined is not an object (evaluating 'data.byteLength')
The expected behaviour is to receive a CreateJobCommandOutput
instance.