Cannot read property 'length' of undefined on data.StackEvents

Open
#8 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript

Research direction

Start in index.js at line 27, where the stack event response is accessed, and compare the undefined data.StackEvents case with the error information in the issue. Reproduce the AWS response that triggers the exception and verify that completion no longer calls length on missing data while the failure is surfaced appropriately.

Written by the indexing model from the issue text.

Description

Looks like data.StackEvents can be undefined, and not have a error set

/usr/local/lib/node_modules/mapbox-cli/node_modules/aws-sdk/lib/request.js:30
            throw err;
                  ^
TypeError: Cannot read property 'length' of undefined
    at Response.<anonymous> (/usr/local/lib/node_modules/mapbox-cli/node_modules/cfn-stack-event-stream/index.js:27:49)
    at Request.<anonymous> (/usr/local/lib/node_modules/mapbox-cli/node_modules/aws-sdk/lib/request.js:353:18)
    at Request.callListeners (/usr/local/lib/node_modules/mapbox-cli/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (/usr/local/lib/node_modules/mapbox-cli/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/usr/local/lib/node_modules/mapbox-cli/node_modules/aws-sdk/lib/request.js:595:14)
    at Request.transition (/usr/local/lib/node_modules/mapbox-cli/node_modules/aws-sdk/lib/request.js:21:10)
    at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/mapbox-cli/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /usr/local/lib/node_modules/mapbox-cli/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/usr/local/lib/node_modules/mapbox-cli/node_modules/aws-sdk/lib/request.js:37:9)
    at Request.<anonymous> (/usr/local/lib/node_modules/mapbox-cli/node_modules/aws-sdk/lib/request.js:597:12)
Dominant language
JavaScript
Stars
8
Forks
3
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mapbox/cfn-stack-event-stream

All issues in mapbox/cfn-stack-event-stream

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.