aws-amplify / aws-amplify/amplify-cli
`Cannot read property 'value' of undefined` when backspacing an input prompt after hitting return
- 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.2.3
### 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
This is sort of an odd flow, but bear with me. In a flow such as `amplify import auth` there is a prompt where we can begin typing to filter the selection list. This works great, but there is a delay between selecting a value and the CLI proceeding (as if it were "loading"). During this delay if we backspace the prompt we can delete a few characters which will cause this error.
```
aws-amplify/reproductions/11174
➜ amplify import auth
Using service: Cognito, provided by: awscloudformation
✔ What type of auth resource do you want to import? · Cognito User Pool and Identity Pool
✔ Select the User Pool you want to import: · us-east-1_oIc5HauQus-east-1_ocHu0
🛑 Cannot read property 'value' of undefined
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/
```
### Expected behavior
- cli disables the input while loading
- cli shows indication it is loading/thinking/working in the background
### Reproduction steps
1. `amplify init -y`
2. `amplify import auth`
3. on the prompt to select your user pool, type a few characters to filter the list
4. make a selection
5. immediately after, hit backspace a few times
6. observe error
### 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
Research direction
Start with the `amplify import auth` command and the user-pool selection prompt, then reproduce the failure using the listed six steps on macOS with Node.js 18. Trace the prompt behavior after a selection while backspacing; done means the input is safely disabled or handled during loading, a loading indication is shown, and the reported error no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, nodejs, typescript
- Domain
- cli, developer-experience
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100