kalajianOriginal post
Apple Developer
Hi there,
I have what looks like a strange issue: I am getting a Warning about a possible unhandled promise rejection, that says "Error: AppwriteException: Missing required parameter: "email"" and it's pointing to my "throw" statement in a try/catch block:
Plain text
try { const newAccount = await account.create( ID.unique(), email, password, username );
if(!newAccount) throw Error;
const avatarUrl = avatars.getInitials(username);
await signIn(email, password);
const newUser = await databases.createDocument( appwriteConfig.databaseId, appwriteConfig.userCollectionId, ID.unique(), { accountId: newAccount.$id, email, username, avatar: avatarUrl, } );
return newUser; } catch (error) { throw new Error(error); }}```
Any ideas?Summary
Possible unhandled promise rejection error due to missing "email" parameter. Check that the "email" parameter is being passed correctly. Fix by ensuring the "email" parameter is included when calling the function in the createUser function.