mapbox / mapbox/cfn-config

stuck when AllowedValues for Type number is present

Open
#172 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
53
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Tried deploying a stack after adding an additional parameter with type: `Number` and `AllowedValues` provided:

e.g.
```
LuckyNumber: {
Type: 'Nuber',
AllowedValues: [0,1,2,3,4,5,6,7,8,9,10]
}
```

the stack update gets stuck before asking for `LuckyNumber` - it hangs until I stop the process and then it shows `TypeError: Cannot use 'in' operator to search for 'value' in 0`

I was able to reproduce this with two different repos.
After removing `AllowedValues` I was able to deploy without problems.

full stacktrace

```
TypeError: Cannot use 'in' operator to search for 'value' in 0
at new Choice (/Users/justynajanczyszyn/REPOS/mapbox/mbxcli/node_modules/@mapbox/cfn-config/node_modules/inquirer/lib/objects/choice.js:26:24)
at Choices.choices.choices.map.val (/Users/justynajanczyszyn/REPOS/mapbox/mbxcli/node_modules/@mapbox/cfn-config/node_modules/inquirer/lib/objects/choices.js:23:14)
at Array.map ()
at new Choices (/Users/justynajanczyszyn/REPOS/mapbox/mbxcli/node_modules/@mapbox/cfn-config/node_modules/inquirer/lib/objects/choices.js:16:28)
at new Prompt (/Users/justynajanczyszyn/REPOS/mapbox/mbxcli/node_modules/@mapbox/cfn-config/node_modules/inquirer/lib/prompts/base.js:43:26)
at new ListPrompt (/Users/justynajanczyszyn/REPOS/mapbox/mbxcli/node_modules/@mapbox/cfn-config/node_modules/inquirer/lib/prompts/list.js:18:5)
at PromptUI.fetchAnswer (/Users/justynajanczyszyn/REPOS/mapbox/mbxcli/node_modules/@mapbox/cfn-config/node_modules/inquirer/lib/ui/prompt.js:85:25)
at MergeMapSubscriber._tryNext (/Users/justynajanczyszyn/REPOS/mapbox/mbxcli/node_modules/rxjs/internal/operators/mergeMap.js:69:27)
at MergeMapSubscriber._next (/Users/justynajanczyszyn/REPOS/mapbox/mbxcli/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
at MergeMapSubscriber.Subscriber.next (/Users/justynajanczyszyn/REPOS/mapbox/mbxcli/node_modules/rxjs/internal/Subscriber.js:67:18)
```

@mapbox/platform

Contributor guide

Open the contributing guide

Research direction

Reproduce with a CloudFormation Number parameter using numeric AllowedValues and trace the prompt construction shown in inquirer/lib/objects/choice.js and choices.js. Confirm that numeric choices no longer trigger the TypeError, that the prompt accepts a value, and that the stack update proceeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.