TypeError: Cannot read property 'Code' of undefined
See original GitHub issueDescribe the bug
Periodically, when an SqsClient sends a ReceiveMessageCommand I receive:
TypeError: Cannot read property 'Code' of undefined
at loadQueryErrorCode (/home/me/node_modules/@aws-sdk/client-sqs/dist/cjs/protocols/Aws_query.js:2583:20)
at deserializeAws_queryReceiveMessageCommandError (/home/me/node_modules/@aws-sdk/client-sqs/dist/cjs/protocols/Aws_query.js:941:17)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async /home/me/node_modules/@aws-sdk/middleware-serde/dist/cjs/deserializerMiddleware.js:6:20
at async /home/me/node_modules/@aws-sdk/middleware-signing/dist/cjs/middleware.js:11:20
at async StandardRetryStrategy.retry (/home/me/node_modules/@aws-sdk/middleware-retry/dist/cjs/StandardRetryStrategy.js:51:46)
at async /home/me/node_modules/@aws-sdk/middleware-sdk-sqs/dist/cjs/receive-message.js:7:22
at async /home/me/node_modules/@aws-sdk/middleware-logger/dist/cjs/loggerMiddleware.js:6:22
Your environment
SDK version number
@aws-sdk/client-sqs": "^3.31.0
Is the issue in the browser/Node.js/ReactNative?
Node.js
Details of the browser/Node.js/ReactNative version
v14.17.5
Steps to reproduce
Please share code or minimal repo, and steps to reproduce the behavior.
await sqsClient.send(new ReceiveMessageCommand({
MaxNumberOfMessages: 1,
QueueUrl: url,
VisibilityTimeout: 20,
WaitTimeSeconds: 2,
}))
Observed behavior
See stack trace above
Expected behavior
Screenshots
Additional context
Issue Analytics
- State:
- Created 2 years ago
- Reactions:15
- Comments:22 (1 by maintainers)
Top Results From Across the Web
JS/Ionic:TypeError: Cannot read property 'code' of undefined
It seems like response.data.error is returning as undefined (or returning nothing, which leads undefined ), that is the reason, ...
Read more >Uncaught TypeError: Cannot read property of undefined In
JavaScript TypeError is thrown when an operand or argument passed to a function is incompatible with the type expected by that operator or...
Read more >What is "TypeError: Cannot read property 'state' of undefined"?
The error message says that you don't have the state property on an undefined object. To decode this, we have to understand the...
Read more >Uncaught TypeError : Cannot read properties of undefined
The solution to TypeError: Cannot read properties of undefined ... The root cause of the error is that the declared variable doesn't have...
Read more >How to Prevent the Error: Cannot Read Property '0' of Undefined
If a property of an object is an array, it's possible to accidentally misspell the key or try to access the array through...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
bump - same issue, please fix
Running into the same error while sending emails with the SES client, the error is masking our efforts to discover the underlying cause.