diff --git a/packages/amplify-ui-components/src/components/amplify-sign-up/amplify-sign-up.tsx b/packages/amplify-ui-components/src/components/amplify-sign-up/amplify-sign-up.tsx index 055b39ea8a5..963bd293c79 100644 --- a/packages/amplify-ui-components/src/components/amplify-sign-up/amplify-sign-up.tsx +++ b/packages/amplify-ui-components/src/components/amplify-sign-up/amplify-sign-up.tsx @@ -133,6 +133,9 @@ export class AmplifySignUp { break; } try { + if (!this.signUpAttributes.username) { + throw new Error(Translations.EMPTY_USERNAME); + } if (this.signUpAttributes.username.indexOf(' ') >= 0) { throw new Error(Translations.USERNAME_REMOVE_WHITESPACE); }