question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'Code' of undefined

See original GitHub issue

Describe 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:open
  • Created 2 years ago
  • Reactions:15
  • Comments:22 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
Cleanshootercommented, Jan 18, 2022

bump - same issue, please fix

5reactions
ronit-chakrabortycommented, Feb 7, 2022

Running into the same error while sending emails with the SES client, the error is masking our efforts to discover the underlying cause.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found