New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.5.5: `serverless project create` crashes on empty profile selection #1005

Closed
markstos opened this Issue Apr 14, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@markstos

markstos commented Apr 14, 2016

Running on Node.js 4.4.1.

To reproduce is simple:

  • Run serverless project create
  • Press enter 4 times.

The following stack trace results. I believe this is because "Existing Profile" was selected. There is no profile, but the code lacks error checking for this case, resulting an attempted action called on an undefined value.

$ serverless project create
 _______                             __
|   _   .-----.----.--.--.-----.----|  .-----.-----.-----.
|   |___|  -__|   _|  |  |  -__|   _|  |  -__|__ --|__ --|
|____   |_____|__|  \___/|_____|__| |__|_____|_____|_____|
|   |   |             The Serverless Application Framework
|       |                           serverless.com, v0.5.5
`-------'

Serverless: Initializing Serverless Project...  
Serverless: Enter a name for this project:  (serverless-b1fkml) 
Serverless: Enter a new stage name for this project:  (dev) 
Serverless: For the "dev" stage, do you want to use an existing Amazon Web Services profile or create a new one?
  > Existing Profile
    Create A New Profile
Serverless: Select a profile for your project: 
/home/mark/.nvm/versions/node/v4.4.1/lib/node_modules/serverless/lib/utils/cli.js:386
      if (Select.state.choices[Select.state.index - 1].action
                                                      ^

TypeError: Cannot read property 'action' of undefined
    at ReadStream.keypressHandler (/home/mark/.nvm/versions/node/v4.4.1/lib/node_modules/serverless/lib/utils/cli.js:386:55)
    at emitTwo (events.js:87:13)
    at ReadStream.emit (events.js:172:7)
    at emitKey (/home/mark/.nvm/versions/node/v4.4.1/lib/node_modules/serverless/node_modules/keypress/index.js:406:12)
    at ReadStream.onData (/home/mark/.nvm/versions/node/v4.4.1/lib/node_modules/serverless/node_modules/keypress/index.js:48:14)
    at emitOne (events.js:77:13)
    at ReadStream.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at ReadStream.Readable.push (_stream_readable.js:111:10)
    at TTY.onread (net.js:529:20)
@imhassan

This comment has been minimized.

Show comment
Hide comment
@imhassan

imhassan Jun 8, 2016

Getting this errror node -v = 6.2.1

`serverless project create -c true


| _ .-----.----.--.--.-----.----| .-----.-----.-----.
| || -| _| | | -| _| | -|_ --|__ --|
|____ ||| _/||| ||||_____|
| | | The Serverless Application Framework
| | serverless.com, v0.5.5
`-------'

Serverless: Initializing Serverless Project...
Serverless: Enter a name for this project: (serverless-hy6y16) TwilioIntegration
Serverless: Enter a new stage name for this project: (dev) prod
Serverless: For the "prod" stage, do you want to use an existing Amazon Web Services profile or create a new one?
Existing Profile

Create A New Profile
Serverless: Select a profile for your project:
/usr/local/lib/node_modules/serverless/lib/utils/cli.js:386
if (Select.state.choices[Select.state.index - 1].action
^

TypeError: Cannot read property 'action' of undefined
at ReadStream.keypressHandler (/usr/local/lib/node_modules/serverless/lib/utils/cli.js:386:55)
at emitTwo (events.js:106:13)
at ReadStream.emit (events.js:191:7)
at emitKey (/usr/local/lib/node_modules/serverless/node_modules/keypress/index.js:406:12)
at ReadStream.onData (/usr/local/lib/node_modules/serverless/node_modules/keypress/index.js:48:14)
at emitOne (events.js:96:13)
at ReadStream.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:172:18)
at ReadStream.Readable.push (_stream_readable.js:130:10)
at TTY.onread (net.js:542:20)
`

imhassan commented Jun 8, 2016

Getting this errror node -v = 6.2.1

`serverless project create -c true


| _ .-----.----.--.--.-----.----| .-----.-----.-----.
| || -| _| | | -| _| | -|_ --|__ --|
|____ ||| _/||| ||||_____|
| | | The Serverless Application Framework
| | serverless.com, v0.5.5
`-------'

Serverless: Initializing Serverless Project...
Serverless: Enter a name for this project: (serverless-hy6y16) TwilioIntegration
Serverless: Enter a new stage name for this project: (dev) prod
Serverless: For the "prod" stage, do you want to use an existing Amazon Web Services profile or create a new one?
Existing Profile

Create A New Profile
Serverless: Select a profile for your project:
/usr/local/lib/node_modules/serverless/lib/utils/cli.js:386
if (Select.state.choices[Select.state.index - 1].action
^

TypeError: Cannot read property 'action' of undefined
at ReadStream.keypressHandler (/usr/local/lib/node_modules/serverless/lib/utils/cli.js:386:55)
at emitTwo (events.js:106:13)
at ReadStream.emit (events.js:191:7)
at emitKey (/usr/local/lib/node_modules/serverless/node_modules/keypress/index.js:406:12)
at ReadStream.onData (/usr/local/lib/node_modules/serverless/node_modules/keypress/index.js:48:14)
at emitOne (events.js:96:13)
at ReadStream.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:172:18)
at ReadStream.Readable.push (_stream_readable.js:130:10)
at TTY.onread (net.js:542:20)
`

license2e pushed a commit to license2e/serverless that referenced this issue Aug 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment