Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

stuck when AllowedValues for Type number is present

Open
#172 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

Description

bug

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 (<anonymous>)
    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

Dominant language
JavaScript
Stars
53
Forks
17
PR merge metrics
No merged PRs in 30d

Getting set up

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

All issues in mapbox/cfn-config

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.