aws-amplify / aws-amplify/amplify-cli

unexpected error when typing an invalid character in a filterable, multi-select field

Open
#11,523 1 comment 0 reactions 0 assignees View on GitHub
bug p2 platform
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Before opening, please confirm:

- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/dev/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### How did you install the Amplify CLI?

pnpm

### If applicable, what version of Node.js are you using?

18

### Amplify CLI Version

10.5.1

### What operating system are you using?

mac

### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

n/a

### Amplify Categories

Not applicable

### Amplify Commands

Not applicable

### Describe the bug

Similar to https://github.com/aws-amplify/amplify-cli/issues/11521, I encountered this using the API category. Typing an invalid character such as the "space" key after filtering the option list to 0 results, the CLI unexpectedly errors

### Expected behavior

CLI does not error when filtering a list of options

### Reproduction steps

1. `amplify init -y`
2. `amplify add auth` > accept defaults
3. `amplify update auth` > add a User Pool Group or two
4. `amplify add api` > REST API
5. follow the prompts, choose to restrict API access by auth/guest users
6. in the filterable, multi-select prompt for CRUD access, press a key to filter the list of results to 0 (I used `[`)
7. press the space bar
8. observe error

```
✔ Restrict API access? (Y/n) · yes
✔ Restrict access by: · Auth/Guest Users
✔ Who should have access? · Authenticated and Guest users
? What permissions do you want to grant to Authenticated users? … h🛑 Cannot read property 'enabled' of undefined
No matching choices
Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: 'amplify diagnose --send-report'
Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

Session Identifier: 48c9d64a-78c0-44da-b400-abc8e1cf0c97
? An unexpected error has occurred, opt in to send an error report to AWS Amplify with non-sensitive project configuration files. Confirm (y/N) ›
```

### GraphQL schema(s)

```graphql
# Put schemas below this line

```

### Project Identifier

_No response_

### Log output

```
# Put your logs below this line

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.